Difference between two dates
CostaAug 17 2012 — edited Aug 17 2012I have two tables master and market
of which market contain three variables like sale start_date, stop_date and duration (difference between start and stop date). I want to retrieve those data
where difference between start and stop date is not matching with duration.
start_date stop_date duration
13-JAN-2012 14-JAN-2012 1 day
18-JAN-2012 18-MAR-2012 3 month
22-APR-2012 22-APR-2012 1 month
09-JUL-2011 09-JUL-2012 365 days
18-JAN-2012 18-MAR-2012 59 days
select a.start_date,a.stop_date,a.duration
from master b, market a
where a.number=b.number
and start_date is not null and stop_date is not null
and duration is not null
and stop_date-start_date=duration