Oracle Date comparison by concatenating 2 fields
Posted on 2007-04-10
I am trying to do a date comparison in an SQL select statement on Oracle 9i. The problem in this particular case is that the date is stored in a field only containing the date and the time is stored in a field with a zero date e.g. "00/00/00 12:01:01".
This is basically what I am trying to do:
AND G16.DESPDATE >= to_date('27/03/2007 17:00','DD/MM/YYYY HH24:MI')
AND G16.DESPDATE <= to_date('28/03/2007 23:45','DD/MM/YYYY HH24:MI')
G16.DESPDATE as I said contains only the date
G16.DESPTIME however contains the zero date AND the time value.
Does anyone know how I can go about concatenating the 2 fields to do this comparison?
Any help would be massively appreciated, I have already spent AGES on this!