Paulo,
given your_table has a column called date_col.
SELECT to_char(date_col, 'Month') FROM your_table WHERE
something is true;
Will give you a response of the month spelled out. Change the
'Month' to 'MM' and you get a two character string from 01 to 12 for the
month. Change it to 'month' and you get a lower case month,
(january).
check the docs on formatting:
http://www.postgresql.org/idocs/index.php?functions-formatting.html
Ted
-----Original Message-----
From: pocm@rnl.ist.utl.pt (Paulo J. Matos)
To: pgsql-sql@postgresql.org
Date: 30 Jan 2002 00:04:18 +0000
Subject: [SQL] Date Parse
> Hi all,
>
> 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?
>
> Best regards,
>
> --
> Paulo J. Matos : pocm(_at_)rnl.ist.utl.pt
> Instituto Superior Tecnico - Lisbon
> Software & Computer Engineering - A.I.
> - > http://www.rnl.ist.utl.pt/~pocm
> ---
> Yes, God had a deadline...
> So, He wrote it all in Lisp!
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org