Reputation: 638
I'm trying to make the following work in PostgreSQL:
SELECT * FROM purchases WHERE CONVERT(expiration_date) < '2013-03-21 13:14:00'
Where CONVERT
is some method that would convert Date
to DateTime
. Any idea how to do this?
Upvotes: 11
Views: 42753
Reputation: 16487
There is no DateTime
type in PostgreSQL, there's timestamp
.
To convert simply do expiration_date::timestamp
but I think it should work without conversion. WHERE expiration_date < '2013-03-21 13:14:00'
should be valid.
Upvotes: 24