Datetime comparison & arithmetic
Posted in 2000
Hello CDI-Members, I don't find any acceptable solution for the following query: table mytable (has lots of data, structure cannot be changed anymore !) a_date DATE, a_time DATETIME HOUR TO SECOND, a_key INTEGER, stuff CHAR(...) I'd like to retrieve some data ordered by point of time (given in following pseudo-code): SELECT Who_Can_Help_To_Combine(a_date, a_time), key FROM mytable ORDER BY 1 The following solutions came to my mind: - use a stored procedure which uses string buffers an datetime conversion - use a temporary table in some way to combine the two date/datetime value Does anyone know an STRAIGHT method to convert a_date,a_time to a_datetime (perhaps using EXTEND,DATETIME,UNITS,MDY....) in my single select ? Any help (except supposing the 2 "solutions" mentioned above) or funny comments (hi Clown) are really welcomed... Read you, Chris (who once thought, that Yesterday and 16:00 would be: 16:00 on Yesterday...)