Roger <[EMAIL PROTECTED]> wrote:
> I have a question.
>
> I trying to write a query as follows
>
> Select *
> >From People
> Where Surname Between 'A%' and 'E%'
> Order by UPPER(Surname);
>
> Now the problem i have is that i get only the Surnames from A up to D
> and the E's are excluded.
>
What is the '%' about? BETWEEN does not understand LIKE-style
patterns. The BETWEEN operator is exactly equivalent to two
comparisons:
x BETWEEN y AND z
is the same as
x>=y AND x<=z
Probably want you want to do is drop the BETWEEN all together
and use two comparisons instead, but make the upperbound a
strict inequality:
WHERE surname>='A' AND surname<'E'
--
D. Richard Hipp <[EMAIL PROTECTED]>
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------