steve4king
IS-IT--Management
Code:
DELE FROM INVOICE_VOID WHERE (DTOC(DATE) + " " +(TIME)) < (SELECT (DTOC(MAX(DATE)) + " " + (TIME)) FROM CASH_OLD)
This does not work obviously as it tries filtering the date after it has changed it to a character.. thus (12/01/01 04:15) > (09/21/07 01:22)
I figured this out so changed the code to:
Code:
DELE FROM CASH_VOID WHERE (DTOC(DATE) + " " +(TIME)) < (SELECT (DTOC(MAX(DATE)) + " " + (TIME)) FROM CASH_OLD)
This fixed the initial select, but when comparing to the other table it is comparing as text again.
Do I need to convert it back to a date before comparing? If so how can I do this?
Thanks in advance,
-Steve W.