parts of date_part() - Mailing list pgsql-sql

From Eric McKeown
Subject parts of date_part()
Date
Msg-id Pine.LNX.3.96.980824182856.299A-100000@farout.palaver.net
Whole thread Raw
Responses Re: [SQL] parts of date_part()  (Brook Milligan <brook@trillium.NMSU.Edu>)
Re: [SQL] parts of date_part()  (Herouth Maoz <herouth@oumail.openu.ac.il>)
List pgsql-sql
Hi there,

Well, I've done some digging in the FAQ, the user documentation, and the
man pages, so I hope nobody screams 'RTFM' on this question, but I suppose
you're welcome to if it was somewhere obvious and I missed it.

I'm looking for a complete list of the different "date parts" that I can
use to extract information about a given datetime value in a table.  For
instance, I know that I can do:

select date_part('day', field_name) from table ;

and that will give me the day of the month of that date.  I've also
played with some other things, like 'month' and 'year'.  However, I was
wondering if there was a way to obtain the name of the day (Tuesday,
Wednesday, etc.) using this function, among other things.  I tried

select date_part('weekday', field_name) from table ;

but that didn't work.  Really, what I need is a list of types that
arguments that I can use for the first paramater of this function.  If
this isn't documented now, and someone has answers, I'd be happy to write
something up for the FAQ or the user's manual.

TIA....

eric

_______________________
Eric McKeown
ericm@palaver.net
http://www.palaver.net


pgsql-sql by date:

Previous
From: David Prieto Carrellan
Date:
Subject: Cursors out of a transaction
Next
From: Eric McKeown
Date:
Subject: this one's simpler