I am trying to select records dated 1st of December 2018 from a table. Even though there are several records postgres is not returning any.
Query:
select *
from dbo."Transactions"
where "DateOfTransaction"::timestamp >=to_date('01-12-2018', 'dd-mm-yyyy')
and "DateOfTransaction"::timestamp <=to_date('01-12-2018', 'dd-mm-yyyy')
I also tried:
select *
from dbo."Transactions"
where "DateOfTransaction"::timestamp >=to_date('01-12-2018 00:00:00', 'dd-mm-yyyy HH24:MI:SS')
and "DateOfTransaction"::timestamp <=to_date('01-12-2018 23:59:59', 'dd-mm-yyyy HH24:MI:SS')
What is the reason for this strange behavior? I have to give date in dd-mm-yyyy format in where condition.
