Subject Re: [firebird-support] Error in conversion in between clause
Author Helen Borrie
At 01:08 PM 10/11/2008, you wrote:
>The following select worked on FB 1.5.5, however on FB 2.1.1 it raises exception "Unsupported field type specified in BETWEEN predicate", but A.Arrival and S.Arrival are timestamp fields:
>
>Select A.ID From Cars A
>Where
>Â A.Situation = 'A' and
>Â (
>Â Â Cast(A.Arrival as Date) between '01.10.2008' and '30.10.2008'
> Â or
>Â Â (Select Min(Cast(S.Arrival as Date)) From History S
>Â Â Where S.Car_ID = A.ID) between '01.10.2008' and '30.10.2008';
>Â );
>
>Why this error?

This SQL seems contaminated by rogue characters...even without all the alphabetti, your statement is suffering from too many semi-colons and not enough brackets. I don't believe it ever worked anywhere. ;-)

Select A.ID From Cars A
Where
A.Situation = 'A'
and
(
(Cast(A.Arrival as Date) between '01.10.2008' and '30.10.2008')
or
( (Select Min(Cast(S.Arrival as Date))
From History S
Where S.Car_ID = A.ID) between '01.10.2008' and '30.10.2008')
);

./heLen