What is the best way to compare two date fields?
I found this thread
944616
But I would have to use some of Oracle's functions to get the results that I need.
I currently have SQL that finds all rows between two dates from the same column (started_time):
select *
from profiles
where trunc(started_time)
between to_date('28-08-2006','DD-MM-YYYY')
and to_date('29-08-2006','DD-MM-YYYY');
But, I also have a field called completed_time and would like to write SQL that would find all rows between started_time and completed_time.
Here is what I've tried to write:
select *
from profiles
where trunc(started_time)
between to_date('28-08-2006','DD-MM-YYYY')
and trunc(completed_timing)
and to_date('29-08-2006','DD-MM-YYYY');
What would be the best way to do this?
thanks
Message was edited by:
cmmiller