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 E4660D1D568 for ; Fri, 21 Nov 2003 11:20:56 +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 55570-03 for ; Fri, 21 Nov 2003 07:20:27 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 54E9FD1D570 for ; Fri, 21 Nov 2003 07:20:25 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id hALBKPNw001379 for ; Fri, 21 Nov 2003 11:20:25 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id hALArYqq091173 for pgsql-sql@postgresql.org; Fri, 21 Nov 2003 10:53:34 GMT From: "nobody" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: How to quote date value? Date: Fri, 21 Nov 2003 10:53:31 -0000 Organization: Hub.Org Networking Services Lines: 39 Message-ID: References: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/321 X-Sequence-Number: 16136 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". "nobody" wrote in message news:bpkmg7$2aj3$1@news.hub.org... > What is correct character to quote date values in SELECT. Is is single > quote? > > When I do: > > SELECT '1/11/2003' AS "InvoiceDate"; > > the returned value is of unknown type (not a date). > > Then I tried: > > SELECT 1/11/2003 AS "InvoiceDate"; > > and the InvoiceDate was set to zero (I guess the engine divided the numbers > in date). > > Then I tried: > > SELECT 1-11-2003 AS "InvoiceDate"; > > and the numbers in date value got substracted. > > Using PostgreSQL 7.4 and PgAdmin 3. > > Any insight is welcome. > >