Also, I am trying to to convert the following but no success? I get errors
The field ACTION_DT is a "date" field in dB.
Msg 242, Level 16, State 3, Line 1
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
--AND (EH.ACTION_DT>=TO_DATE ('17-12-2017 00:00:00', 'DD-MM-YYYY HH24:MI:SS')---oracle
-- AND EH.ACTION_DT<TO_DATE ('24-12-2017 00:00:00', 'DD-MM-YYYY HH24:MI:SS'))--- oracle
AND (EH.ACTION_DT>= CAST('17-12-2017 00:00:00' As datetime) --sql
and EH.ACTION_DT< CAST('24-12-2017 00:00:00' as datetime)) --sql
Also tried this as well but no success:
and (EH.ACTION_DT>= Convert(datetime,'17-12-2017 00:00:00', 114)
and EH.ACTION_DT< Convert(datetime ,'24-12-2017 00:00:00', 114))
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.