X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D97DFD1C7EF for ; Fri, 1 Aug 2003 18:28:18 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 63140-02 for ; Fri, 1 Aug 2003 15:27:11 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 2E4D6D1C515 for ; Fri, 1 Aug 2003 15:28:17 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id C31C110258; Fri, 1 Aug 2003 14:21:01 -0400 (EDT) Received: from [10.0.2.9] (unknown [10.0.2.9]) by mailav.tor1.inquent.com (Postfix) with ESMTP id E0E1910248; Fri, 1 Aug 2003 14:20:59 -0400 (EDT) Subject: Re: What day is it - when it isn't NOW()? From: Rod Taylor To: tomg@sqlclinic.net Cc: Postgres SQL List In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Ch/KetyWYnJXvpAajELb" Message-Id: <1059762491.41648.8.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 01 Aug 2003 18:28:11 +0000 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/8 X-Sequence-Number: 14624 --=-Ch/KetyWYnJXvpAajELb Content-Type: text/plain Content-Transfer-Encoding: quoted-printable '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. >=20 > Can anyone point me to the right function/combination of functions > to achieve this? >=20 > Thanks! >=20 > ----------------------------------------------------------------------- > 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 >=20 > // Welches ist das groessere Verbrechen? > // Massenvernichtungswaffen besitzen oder sie erfinden? >=20 >=20 >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings >=20 --=-Ch/KetyWYnJXvpAajELb Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD4DBQA/KrE66DETLow6vwwRAs3/AJ4kPnw/ryPBoBc98R5zcDqMIiUrjQCY0GiG T2Owv+w9WZcpqM5LpXmMxQ== =knQp -----END PGP SIGNATURE----- --=-Ch/KetyWYnJXvpAajELb--