Weeks elapsed to Months elapsed conversion

Поиск
Список
Период
Сортировка
От Allan Kamau
Тема Weeks elapsed to Months elapsed conversion
Дата
Msg-id 483FC725.5030800@sanbi.ac.za
обсуждение исходный текст
Ответы Re: Weeks elapsed to Months elapsed conversion  ("Bart Degryse" <Bart.Degryse@indicator.be>)
Re: Weeks elapsed to Months elapsed conversion  ("Rodrigo E. De León Plicet" <rdeleonp@gmail.com>)
Re: Weeks elapsed to Months elapsed conversion  (Richard Huxton <dev@archonet.com>)
Re: Weeks elapsed to Months elapsed conversion  ("Fernando Hevia" <fhevia@ip-tel.com.ar>)
Список pgsql-sql
Hi all,
I have a simple question (tried googling but found no answers). How do I 
convert weeks elapsed into months elapsed?
I have data that contains duration in weeks (without any other date 
values such as year and so on) for example a week value of 14 and I 
would like to convert the 14 weeks to 3 months (some lose of accuracy 
expected).
Expected tests may be:
14 weeks yields 3 months.
1 weeks yields 0 months.

Is there such a function. The rudimentary solution (may reduce lose of 
accuracy) am thinking of is to add the weeks to the value returned by 
clock_timestamp() then subtract clock_timestamp() from it. The question 
now is how to convert the returned value to months elapsed as opposed to 
days elapsed.

Allan.


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

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: String comparison problem.
Следующее
От: "Bart Degryse"
Дата:
Сообщение: Re: Weeks elapsed to Months elapsed conversion