If its already saved as a timestamp with timezone (or timestamp without timezone) in postgres, then date_trunc(‘day’, [field_name]) will do the trick.
--Stephen
From: JORGE MALDONADO <jorgemal1960@gmail.com>
Sent: Wednesday, April 18, 2018 8:01 AM
To: pgsql-novice <pgsql-novice@postgresql.org>
Subject: Extract date portion of a datetime field
Hello,
I have a table with a datetime field which saves (of course) date and time information. I need to design a query to count the number of records of each date without taking into account the time portion. I have seen that I can use functions like EXTRACT but I do not find how to extract the whole date only.
I will very much appreciate your feedback.