I have a SQL query that works smoothly. It takes the difference between sets of dates that are >=0 and <=0. here it is:
SELECT createdate, id, objid, start_date, end_date
FROM greggs_date, HNEMap
where active =1
and trunc (createdate-start_date) >=0 and trunc (createdate-end_date) <=0;
Problem is I can't output the differences. In MS SQL Server you can show the number of days difference with the datediff function named in the SELECT part of the SQL statement not so with trunc used to get date differences. How can this query be rework to show the actual days of difference between start and end from create date.