Re: Error in select

From: joel garry <joel-garry_at_home.com>
Date: Fri, 9 Nov 2012 08:39:15 -0800 (PST)
Message-ID: <64cea324-1256-4546-a8a8-ad4d4a668d70_at_b4g2000pby.googlegroups.com>



On Nov 9, 1:17 am, erich.fr..._at_gmail.com wrote:
> Hello,
> I have such select:
>
> SELECT * FROM ifsinfo.q_ial_wysylki_planowane where "Planowana_data" < to_date('09/11/2012','DD/MM/YYYY')
>
> and it's work good, but select:
>
> SELECT * FROM ifsinfo.q_ial_wysylki_planowane where 'Planowana_data' < to_date('09/11/2012','DD/MM/YYYY')
> generate error:
> 01841. 00000 -  "(full) year must be between -4713 and +9999, and not be 0"
> *Cause:    Illegal year entered
> *Action:   Input year in the specified range
>
> Why?
> I must put such select in php - and i have problem with "" and ' '.
>
> Thanks in advance for help.
> Q.

The single quotes mean you are referencing a value rather than a column name, so it is trying to implicitly convert Planowana_data to a date that can compare to the to_date value.

jg

--
_at_home.com is bogus.
http://www.businessinsider.com/hp-shows-off-new-itanium-servers-2012-11
http://en.wikipedia.org/wiki/Pat_Paulsen#Quotes
Received on Fri Nov 09 2012 - 17:39:15 CET

Original text of this message