dates

Started by mixoabout 24 years ago2 messagesgeneral
Jump to latest
#1mixo
mixo@beth.uniforum.org.za

I have a table with column of time stamps of when a row entry was created.
How can I get the entries of a particular day (date) from these without
having to
resort to 'where creation_date like somedate' ?

#2Stephane Bortzmeyer
bortzmeyer@netaktiv.com
In reply to: mixo (#1)
Re: dates

On Fri, Apr 05, 2002 at 04:14:15PM +0200,
mixo <mixo@beth.uniforum.org.za> wrote
a message of 13 lines which said:

I have a table with column of time stamps of when a row entry was created.
How can I get the entries of a particular day (date) from these without
having to
resort to 'where creation_date like somedate' ?

select * from MYTABLE where extract (day from MYDATECOLUMN) = extract (day from timestamp '2001-03-08') ;

http://www.fr.postgresql.org/users-lounge/docs/7.2/postgres/functions-datetime.html#FUNCTIONS-DATETIME-DATEPART