Skip to content
Advertisement

Comparing two dates in Oracle after using TO_DATE function

I have the following Oracle Query that is converting todays date and the date field from the table into the same format. However, when trying to compare the two they aren’t coming up as equal.

The cast is used on the field in my table, both these return.

enter image description here

However, when adding the following where statement no rows are returned. I can’t work out why these wouldn’t be classed as equal?

Any help appreciated.

Advertisement

Answer

The date is ALREADY a date. You don’t need to convert it. You may need to remove the time component. Does this do what you want?

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement