Hello,
I am trying to use the CAST function as part of the where clause. Is it possible?
[code]
SELECT T.*, CAST(S.SENDSCHEDDT AS TIMESTAMP),
FROM MASTER T INNER JOIN SCHEDULE S on T.SCHEDULEID=S.SCHEDULEID
WHERE T.STATUSCD=1
AND T.ENABLEDFLAG = 1
AND S.SENDSCHEDDT BETWEEN TO_TIMESTAMP('2018-02-05 19:17:59', 'yyyy-MM-dd HH24:mi:ss')
AND TO_TIMESTAMP('2018-02-05 19:18:29', 'yyyy-MM-dd HH24:mi:ss')
[/code}
Instead of the TO_TIMESTAMP, I would like to avoid it. I thought of using the CAST there or reference it from the select clause? Possible? I tried
[code]
AND S.SENDSCHEDDT BETWEEN CAST('2018-02-04 19:17:59' AS TIMESTAMP)
AND CAST('2018-02-05 19:18:29' AS TIMESTAMP)
[/code]
But I get ORA-01843: not a valid month
Any advice is appreciate.
Running 12cR1