I have this statement that I need to execute:
DELETE FROM callcenter..tRecipQueue WHERE DATEDIFF(dd, expiration_date, GetDate()) > 368
Of course it doesn't work because expiration_date is a varchar data type, which contains MM/DD/YYYY value. How can I efficiently cast or convert that data, so my sp won't complain about this error?
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.
Thanks!
DELETE FROM callcenter..tRecipQueue WHERE DATEDIFF(dd, expiration_date, GetDate()) > 368
Of course it doesn't work because expiration_date is a varchar data type, which contains MM/DD/YYYY value. How can I efficiently cast or convert that data, so my sp won't complain about this error?
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.
Thanks!