Re: Formatting a month in query output - Mailing list pgsql-novice

From Sean Davis
Subject Re: Formatting a month in query output
Date
Msg-id 003001c50282$d4d9ba50$7d75f345@WATSON
Whole thread Raw
In response to Formatting a month in query output  ("Rodolfo J. Paiz" <rpaiz@simpaticus.com>)
List pgsql-novice
Check out the documentation here:

http://www.postgresql.org/docs/8.0/interactive/functions-formatting.html#FUNCTIONS-FORMATTING-TABLE

Something like
select to_char(date_col,'Month YYYY') from tablename;

might do the trick, if date_col is your column with a timestamp.

Sean

----- Original Message -----
From: "Rodolfo J. Paiz" <rpaiz@simpaticus.com>
To: <pgsql-novice@postgresql.org>
Sent: Monday, January 24, 2005 8:42 PM
Subject: [NOVICE] Formatting a month in query output


> Hi!
>
> I have a query which needs to provide a monthly report. Thanks to the
> date_trunc() function someone mentioned in a thread earlier today, I got
> the query working properly. However, each month is '2004-10-01 00:00:00'
> and I would like to have "October 2004".
>
> Which function, if any, would help me do this formatting trick? And
> where can I read more about it? Or must I use a PHP case statement in
> the web page to do this reformatting manually?
>
> Thanks,
>
> --
> Rodolfo J. Paiz <rpaiz@simpaticus.com>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>



pgsql-novice by date:

Previous
From: Jason Dixon
Date:
Subject: Re: SQL and function reference?
Next
From: Alexander Borkowski
Date:
Subject: Re: Formatting a month in query output