Friday, May 30, 2008

Re: [SQL] Weeks elapsed to Months elapsed conversion

On Fri, May 30, 2008 at 4:21 AM, Allan Kamau <allank@sanbi.ac.za> 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)

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

No comments: