Re: Insert into a date field

From: "Hiltibidal, Robert" <Robert(dot)Hiltibidal(at)argushealth(dot)com>
To: "Ezequias Rodrigues da Rocha" <ezequias(dot)rocha(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Insert into a date field
Date: 2007-02-02 14:56:36
Message-ID: A6C93EF9812C8346A8E8BD6AE573E52D055B9736@ARG-EXVS01.corp.argushealth.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Try this:

'1/9/1963'

I'm interpreting your date to be January 9, 1963.

-R

________________________________

From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-owner(at)postgresql(dot)org] On Behalf Of Ezequias Rodrigues da Rocha
Sent: Friday, February 02, 2007 7:08 AM
To: pgsql-sql(at)postgresql(dot)org
Subject: [SQL] Insert into a date field

Hi list,

I am trying to insert a record in a table with a date field but the postgresql reports me the following error:

ERROR: column "data_nascimento" is of type date but expression is of type integer
SQL state: 42804
Hint: You will need to rewrite or cast the expression.

I tryed like this:

'1963-09-01'
'1963-09-01'::date
1963-09-01

And notthing

Thanks in advance.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/

PRIVILEGED AND CONFIDENTIAL
This email transmission contains privileged and confidential information intended only for the use of the individual or entity named above. If the reader of the email is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any use, dissemination or copying of this email transmission is strictly prohibited by the sender. If you have received this transmission in error, please delete the email and immediately notify the sender via the email return address or mailto:postmaster(at)argushealth(dot)com(dot) Thank you.

Browse pgsql-sql by date

  From Date Subject
Next Message Ezequias Rodrigues da Rocha 2007-02-02 15:00:53 Re: Duplicate records
Previous Message Bart Degryse 2007-02-02 14:13:11 Re: Duplicate records