pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: nobody <nobody@nowhere.near.here>
To: pgsql-sql@postgresql.org
Subject: Re: How to quote date value?
Date: Fri, 21 Nov 2003 10:53:31 -0000
Message-ID: <bpkqrd$2p0n$1@news.hub.org> (raw)
References: <bpkmg7$2aj3$1@news.hub.org>

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.
>
>





view thread (6+ messages)  latest in thread

Message-ID: <bpkqrd$2p0n$1@news.hub.org>
Permalink:  ../bpkqrd$2p0n$1@news.hub.org/
Also on:    postgresql.org/message-id/bpkqrd$2p0n$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: nobody@nowhere.near.here
  Subject: Re: How to quote date value?
  In-Reply-To: <bpkqrd$2p0n$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox