From: | "Andrew G(dot) Hammond" <drew(at)xyzzy(dot)dhs(dot)org> |
---|---|
To: | "Paulo J(dot) Matos" <pocm(at)rnl(dot)ist(dot)utl(dot)pt> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Date Parse |
Date: | 2002-01-30 00:45:51 |
Message-ID: | 1012351553.3185.21.camel@xyzzy |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Use the SQL EXTRACT function. This is covered in the docs at
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT
Briefly, SELECT EXTRACT(MONTH FROM TIMESTAMP '2001-02-30 12:34:56');
returns 2
On Tue, 2002-01-29 at 19:04, Paulo J. Matos wrote:
> I have a field in a table of type date.
> In a results set I get some dates. How can I access the month in
> those dates?
--
Andrew G. Hammond mailto:drew(at)xyzzy(dot)dhs(dot)org
http://xyzzy.dhs.org/~drew/
56 2A 54 EF 19 C0 3B 43 72 69 5B E3 69 5B A1 1F
613-389-5481
5CD3 62B0 254B DEB1 86E0 8959 093E F70A B457 84B1
"To blow recursion you must first blow recur" -- me
From | Date | Subject | |
---|---|---|---|
Next Message | postgresql | 2002-01-30 00:59:39 | Re: Date Parse |
Previous Message | Paulo J. Matos | 2002-01-30 00:04:18 | Date Parse |