Thomas,
> SELECT to_char(now(), 'Day'); returns Friday as I'd hoped.
> But how do I return the day of the week for a specific date other
> than now()? I'm looking for something along the lines of:
> SELECT to_char('2003-08-04', 'Day') without much success.
>
> Can anyone point me to the right function/combination of functions
> to achieve this?
Well, you could try the online docs under "Functions and operators" <grin>.
Two possibilities:
SELECT to_char('2003-08-04'::TIMESTAMP, 'Day') should make the to_char version
work for you.
Alternately, SELECT EXTRACT(dow FROM '2003-08-04') will give you a numerical
(0-6) day of the week.
--
Josh Berkus
Aglio Database Solutions
San Francisco