Re: converting a specified year and week into a date

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: converting a specified year and week into a date
Дата
Msg-id 45D2EA15.9080303@magproductions.nl
обсуждение исходный текст
Ответ на converting a specified year and week into a date  (vanessa <vanessaknell@gmail.com>)
Ответы Re: converting a specified year and week into a date  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: converting a specified year and week into a date  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
vanessa wrote:
> hi guys,
> i was just wondering if it was at all possible to turn a year and a given
> week number into a real date just using postgresql commands?
>
>
> e.g. if i have year = 2004 and week = 1,
>     can i turn that into say 2004-01-01 (so that the specified
>     date is the one for the beginning of week 1 in the year 2004
>
>
> thanks
> vanessa  :)

I think you're looking for this:

select to_date('01 2004', 'WW YYYY');
  to_date
------------
 2004-01-01
(1 row)

select to_date('02 2004', 'WW YYYY');
  to_date
------------
 2004-01-08
(1 row)

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
   7500 AK Enschede

// Integrate Your World //

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Having a problem with my stored procedure
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: converting a specified year and week into a date