Situation: data field StartDate with data type: datetime year to second
With the SQL statement: select count(*) from table where StartDate = EXTEND
('1/1/2007',YEAR TO SECOND)
i got error -1262 "on numeric character in datetime or interval".
What' s wrong ?
Without EXTEND - as text literal - the sql statement is o.k.
select count(*) from table where StartDate = '2007-01-01 00:00:00'
Thanks for your tips
Martin Thole
↪ replying to Martin Thole
On Nov 21, 8:02 am, "Martin Thole" <m...@o-b-s.de> wrote:
> Situation: data field StartDate with data type: datetime year to second
>
> With the SQL statement: select count(*) from table where StartDate = EXTEND
> ('1/1/2007',YEAR TO SECOND)
> i got error -1262 "on numeric character in datetime or interval".
>
> What' s wrong ?
>
> Without EXTEND - as text literal - the sql statement is o.k.
> select count(*) from table where StartDate = '2007-01-01 00:00:00'>
> Thanks for your tips
>
> Martin Thole
EXTEND uses the same ISO date format as literal datetimes, try:
select count(*) from table where StartDate = EXTEND
('2007-01-01',YEAR TO SECOND);
Art S. Kagel