Re: Getting the week of a date

Поиск
Список
Период
Сортировка
От sad
Тема Re: Getting the week of a date
Дата
Msg-id 200402161623.24195.sad@bankir.ru
обсуждение исходный текст
Ответ на Re: Getting the week of a date  (Robert Creager <Robert_Creager@LogicalChaos.org>)
Список pgsql-sql
EXCUSE ME, GUYS !

i forgot to add one monome:
7*(((to_char(date_trunc('month',now()),'D'))::INT2-1)/4)
which is stands for skip a first week of month in case it is not consist Wed

finally the select will be similar the following

SELECT 7*(((to_char(date_trunc('month',now()),'D'))::INT2-1)/4) + 1 -
(to_char(date_trunc('month',now()),'D'))::INT2  +  7*3-3 ;

4 - is a number of Wed in a week (in postgresql numeration)




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

Предыдущее
От: "Mark Roberts"
Дата:
Сообщение: Date format problems
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Date format problems