Re: How to quote date value? - Mailing list pgsql-sql

From nobody
Subject Re: How to quote date value?
Date
Msg-id bpkqrd$2p0n$1@news.hub.org
Whole thread Raw
In response to How to quote date value?  ("nobody" <nobody@nowhere.near.here>)
List pgsql-sql
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" <nobody@nowhere.near.here> 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.
>
>




pgsql-sql by date:

Previous
From: "nobody"
Date:
Subject: How to quote date value?
Next
From: dbichko@genpathpharma.com (Dmitri Bichko)
Date:
Subject: OFFSET and subselects