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: How to quote date value?
Date: Fri, 21 Nov 2003 09:39:18 -0000
Message-ID: <bpkmg7$2aj3$1@news.hub.org> (raw)

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: <bpkmg7$2aj3$1@news.hub.org>
Permalink:  ../bpkmg7$2aj3$1@news.hub.org/
Also on:    postgresql.org/message-id/bpkmg7$2aj3$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: <bpkmg7$2aj3$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