Re: Last day of month

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Last day of month
Дата
Msg-id 403D7676.6080306@joeconway.com
обсуждение исходный текст
Ответ на Re: Last day of month  ("Greg Sabino Mullane" <greg@turnstep.com>)
Ответы Re: Last day of month  (Frank Bax <fbax@sympatico.ca>)
Список pgsql-sql
Greg Sabino Mullane wrote:
>>How to find the last sunday/mon..../sat of any given month.
>  
> There is probably a smoother way to do it, but here is a
> quick little function to do what you ask. Feed it a date
> and a number, where 0 is Sunday, 1 is Monday, etc.

oops...forget my last reply...I was a bit too quick on the draw. Try 
this instead:

regression=# select date_trunc('month', current_date + '1 
month'::interval) - '1 day'::interval;      ?column?
--------------------- 2004-02-29 00:00:00
(1 row)

Joe



В списке pgsql-sql по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: Last day of month
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Scalar in a range (but textual not numeric)