An existing DB I am working with was created using a field for each part of a date instead of one date field. With a date field it is easy enough to write a query to get everything greater than a certain date. Is there a good way to write a query against each column (year, julian_day, hour, minute, second) to return values after a certain date. Assuming I want everything after date X The only thing I can think of in pseudo code is
If yearDB > yearX OR
yearDB = yearX and julianDayDB > julianDayX OR
yearDB = yearX and julianDayDB = julianDayX and
hourDB > hourX OR
etc.
Written in SQL as a WHERE clause with the above AND/OR groups.
If yearDB > yearX OR
yearDB = yearX and julianDayDB > julianDayX OR
yearDB = yearX and julianDayDB = julianDayX and
hourDB > hourX OR
etc.
Written in SQL as a WHERE clause with the above AND/OR groups.