parts of date_part()

From: Eric McKeown <ericm(at)palaver(dot)net>
To: PGsql <pgsql-sql(at)postgreSQL(dot)org>
Subject: parts of date_part()
Date: 1998-08-24 23:33:53
Message-ID: Pine.LNX.3.96.980824182856.299A-100000@farout.palaver.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)palaver(dot)net
http://www.palaver.net

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Eric McKeown 1998-08-25 00:06:45 this one's simpler
Previous Message David Prieto Carrellan 1998-08-24 16:38:29 Cursors out of a transaction