Notice the date usage here
1 | select PO.PONUM, DESCRIPTION, ORDERDATE, STATUS, PO1, CNT |
Note: In this example - Collect_Date had a datatype of DATE
1 | select collect_date, collect_name, submitter_seq, expected_date |
There might be numbers in the time portion of the Collect_Date column (which there shouldn’t, because this is declared as a date). When I wrap ‘to_date’ around collect_date I started getting results
A second way to fix the collect_date function is to use the trunc function
1 | where trunc(collect_date) = to_date('29-DEC-24', 'DD-MON-YY') |
which truncates off the time.
Here is how to turn a varchar into a timestamp
1 | select to_timestamp('2022-07-12 07:35:00 AM', 'YYYY-MM-DD HH:MI:SS AM') dt, d.* |
more information: