From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Burke <michael@engtech.ca>
Cc: pgsql-sql@postgresql.org
Cc: aarni@kymi.com
Subject: Re: Querying date_time for date only ?
Date: Tue, 20 Dec 2005 10:05:37 -0500
Message-ID: <29114.1135091137@sss.pgh.pa.us> (raw)
In-Reply-To: <200512200919.49986.michael@engtech.ca>
References: <200512201459.07358.aarni@kymi.com>
<200512200919.49986.michael@engtech.ca>
Michael Burke <michael@engtech.ca> writes:
> On December 20, 2005 08:59 am, Aarni Ruuhimäki wrote:
>> I have a time stamp without time zone field, YYYY-MM-DD hh:mm:ss, in my
>> table. I want to also find something just for a particular day regardless
>> of the time.
> You can try,
> SELECT field::date FROM mytable;
The date_trunc() function can also be useful for this sort of thing,
particularly if you need to round off to something finer or coarser
than days.
http://www.postgresql.org/docs/8.1/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael@engtech.ca, aarni@kymi.com
Subject: Re: Querying date_time for date only ?
In-Reply-To: <29114.1135091137@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox