X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 980A4D1CA61 for ; Fri, 21 Nov 2003 19:21:24 +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 70254-06 for ; Fri, 21 Nov 2003 15:20:53 -0400 (AST) Received: from mail.greatgulfhomes.com (unknown [216.94.125.243]) by svr1.postgresql.org (Postfix) with ESMTP id 6B18AD1B53B for ; Fri, 21 Nov 2003 15:20:52 -0400 (AST) Received: from terrynew2 (firewall.development.greatgulfhomes.com [216.191.203.106]) by mail.greatgulfhomes.com (Postfix) with SMTP id 1FA193669EA; Fri, 21 Nov 2003 14:20:41 -0500 (EST) From: To: "'Stephan Szabo'" , Subject: Re: How to quote date value? Date: Fri, 21 Nov 2003 14:16:06 -0500 Message-ID: <001701c3b063$e9fb0960$2766f30a@development.greatgulfhomes.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 In-reply-to: <20031121110022.U75942@megazone.bigpanda.com> Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/318 X-Sequence-Number: 16133 If you want an explicit date, then cast it like this: SELECT '1/11/2003'::date AS "InvoiceDate"; Terry Fielder Manager Software Development and Deployment Great Gulf Homes / Ashton Woods Homes terry@greatgulfhomes.com Fax: (416) 441-9085 > -----Original Message----- > From: pgsql-sql-owner@postgresql.org > [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Stephan Szabo > Sent: Friday, November 21, 2003 2:04 PM > To: pgsql-sql@postgresql.org > Subject: Re: [SQL] How to quote date value? > > > > On Fri, 21 Nov 2003, Gaetano Mendola wrote: > > > nobody wrote: > > > I have found it in documentation, it is single quote. But > it does not > > > explain why > > > > > > SELECT '1/11/2003' AS "InvoiceDate"; > > > > > > returns "unknown" data type instead of "date". > > (I haven't seen the original message yet, so I'm replying to a reply) > Date literals are generally written as: > DATE '1/11/2003' > > PostgreSQL will try to guess what type you meant with quoted > strings in > expressions, but in the above there isn't enough context to > do guess that > you meant a date really (it should probably actually be > thought of as a > string in such cases). > > > ---------------------------(end of > broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings >