Re: Extract date portion of a datetime field

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Extract date portion of a datetime field
Date: 2018-04-18 14:04:04
Message-ID: 28855.1524060244@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

JORGE MALDONADO <jorgemal1960(at)gmail(dot)com> writes:
> 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.

Cast to date?

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Scott Ford 2018-04-18 14:04:19 Re: Extract date portion of a datetime field
Previous Message JORGE MALDONADO 2018-04-18 14:01:02 Extract date portion of a datetime field