From: Rod Taylor <rbt@rbt.ca>
To: tomg@sqlclinic.net
Cc: Postgres SQL List <pgsql-sql@postgreSQL.org>
Subject: Re: What day is it - when it isn't NOW()?
Date: 01 Aug 2003 18:28:11 +0000
Message-ID: <1059762491.41648.8.camel@jester> (raw)
In-Reply-To: <Pine.LNX.4.44.0308011423030.28566-100000@q8.nrnet.org>
References: <Pine.LNX.4.44.0308011423030.28566-100000@q8.nrnet.org>
'2003-08-04' is ambiguous. It could be a text string, a date, something
else. So cast it.
SELECT to_char('2003-08-04'::date, 'Day');
> 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?
>
> Thanks!
>
> -----------------------------------------------------------------------
> Thomas Good e-mail: tomg@sqlclinic.net
> Programmer/Analyst phone: (+1) 718.818.5528
> Residential Services fax: (+1) 718.818.5056
> Behavioral Health Services, SVCMC-NY mobile: (+1) 917.282.7359
>
> // Welches ist das groessere Verbrechen?
> // Massenvernichtungswaffen besitzen oder sie erfinden?
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>
Attachments:
signature.asc (application/pgp-signature, 186B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rbt@rbt.ca, tomg@sqlclinic.net
Subject: Re: What day is it - when it isn't NOW()?
In-Reply-To: <1059762491.41648.8.camel@jester>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox