Re: [SQL] Weeks elapsed to Months elapsed conversion

2008-05-30 Thread Fernando Hevia
> > 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

Re: [SQL] Weeks elapsed to Months elapsed conversion

2008-05-30 Thread Richard Huxton
Allan Kamau wrote: 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 c

Re: [SQL] Weeks elapsed to Months elapsed conversion

2008-05-30 Thread Rodrigo E. De León Plicet
On Fri, May 30, 2008 at 4:21 AM, Allan Kamau <[EMAIL PROTECTED]> wrote: > Expected tests may be: > 14 weeks yields 3 months. > 1 weeks yields 0 months. Assuming 4 week months: SELECT 14 / 4 AS "3 months", 1 / 4 AS "0 months" 3 months | 0 months --+-- 3 |0 (1 row)

Re: [SQL] Weeks elapsed to Months elapsed conversion

2008-05-30 Thread Bart Degryse
Approx. 52 weeks in a year, thus 13 weeks in 3 months. select numberofweeks/13*3 as numberofmonths from yourtable or if you want whole months returned select floor(numberofweeks/13*3) as numberofmonths from yourtable >>> Allan Kamau <[EMAIL PROTECTED]> 2008-05-30 11:21 >>> Hi all, I have a sim

[SQL] Weeks elapsed to Months elapsed conversion

2008-05-30 Thread Allan Kamau
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