Re: How to find out the weekday from a date???

From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: Jose Manuel Lorenzo Lopez <jose-manuel(dot)lorenzo-lopez(at)ica(dot)conti(dot)de>
Cc: PGSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to find out the weekday from a date???
Date: 2001-07-17 14:59:33
Message-ID: 3B5452D5.C408178F@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I want to extract the weekday of a given 'date' type field in my table
> when selecting. How can I do this?
...
> select extract(dow from timestamp(day)), day, userid
> from bschft_days where date_part('month', day) = '3';
...
> ERROR: parser: parse error at or near "dow"

That seems to work on 7.1.x. Perhaps you are using an older version? In
either case, you can try putting single quotes around "dow", like

select extract('dow' from timestamp(day)), day, userid
from bschft_days where date_part('month', day) = '3';

hth

- Thomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ben-Nes Michael 2001-07-17 15:06:18 Re: VACUUM ANALYZE
Previous Message Ryan Mahoney 2001-07-17 14:56:31 Re: How to find out the weekday from a date???