Re: Formatting a month in query output

Поиск
Список
Период
Сортировка
От Sean Davis
Тема Re: Formatting a month in query output
Дата
Msg-id 003001c50282$d4d9ba50$7d75f345@WATSON
обсуждение исходный текст
Ответ на Formatting a month in query output  ("Rodolfo J. Paiz" <rpaiz@simpaticus.com>)
Список 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 по дате отправления:

Предыдущее
От: Jason Dixon
Дата:
Сообщение: Re: SQL and function reference?
Следующее
От: Alexander Borkowski
Дата:
Сообщение: Re: Formatting a month in query output