X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 910FFD1E929 for ; Fri, 19 Mar 2004 13:48:03 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 95265-09 for ; Fri, 19 Mar 2004 09:48:03 -0400 (AST) Received: from srvr3.iniquinet.com (srvr2.iniquinet.com [64.240.87.12]) by svr1.postgresql.org (Postfix) with SMTP id 665DED1E414 for ; Fri, 19 Mar 2004 09:47:59 -0400 (AST) Received: (qmail 4022 invoked by uid 104); 19 Mar 2004 13:27:26 -0000 Received: from Robert_Creager@LogicalChaos.org by srvr3.iniquinet.com by uid 101 with qmail-scanner-1.15 (clamscan: 0.65. spamassassin: 2.55. Clear:SA:0(-7.6/6.0):. Processed in 33.408714 secs); 19 Mar 2004 13:27:26 -0000 Received: from unknown (HELO thunder.mshome.net) (216.58.165.145) by srvr3.iniquinet.com with SMTP; 19 Mar 2004 13:26:52 -0000 Received: from localhost.localdomain (thunder.mshome.net [192.168.0.250]) by thunder.mshome.net (Postfix) with ESMTP id 9FEB6D19FB; Fri, 19 Mar 2004 06:47:27 -0700 (MST) Received: from logicalchaos.org (thunder.mshome.net [192.168.0.250]) by thunder.mshome.net (Postfix) with SMTP id 8D9EDD19ED; Fri, 19 Mar 2004 06:47:25 -0700 (MST) Date: Fri, 19 Mar 2004 06:47:14 -0700 From: Robert Creager To: Martin Marques Cc: pgsql-sql@postgresql.org Subject: Re: inverse of "day of year" Message-Id: <20040319064714.405b304e.Robert_Creager@LogicalChaos.org> In-Reply-To: <200403190906.17641.martin@bugs.unl.edu.ar> References: <200403190906.17641.martin@bugs.unl.edu.ar> Organization: Starlight Vision, LLC. X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i586-mandrake-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Multipart_Fri__19_Mar_2004_06_47_14_-0700_=.EA)'AQ9a)11MwN" USER_IN_WHITELIST autolearn=ham version=2.63 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/202 X-Sequence-Number: 17301 --Multipart_Fri__19_Mar_2004_06_47_14_-0700_=.EA)'AQ9a)11MwN Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit When grilled further on (Fri, 19 Mar 2004 09:06:17 -0300), Martin Marques confessed: > Is there a function that would give me the date for a given day of year? > > Something like the inverse of "EXTRACT(doy FROM date)"? > Something like: select date_trunc( 'year', now() ) + (extract( doy from now() ) - 1) * '1day'::interval; Later, Rob -- 06:46:54 up 8 days, 9:58, 2 users, load average: 2.00, 2.11, 2.09 Linux 2.4.21-0.13_test #60 SMP Sun Dec 7 17:00:02 MST 2003 --Multipart_Fri__19_Mar_2004_06_47_14_-0700_=.EA)'AQ9a)11MwN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iEYEARECAAYFAkBa+e0ACgkQLQ/DKuwDYzkwAACgl0JtSw9BnP8DI6mR02VYohQI vbIAoJQ6nqhybHGfkZdficy655VRiHbN =9StM -----END PGP SIGNATURE----- --Multipart_Fri__19_Mar_2004_06_47_14_-0700_=.EA)'AQ9a)11MwN--