>In the past,
>I am using Window English Version or Traditional Chinese Version.
>The following sql is :-
>
>SELECT * from companytable where companytable.code >= pStartCode .AND. code <= pEndCode
>case 1)
> if the pStartCode and pEndCode are the same. e.g(IBM)
> the sql will list out the information equivalent to "IBM" only
> the sql work fines on all OS
>case 2)
> if the pStartCode = "A", pEndCode = "C",
> the sql will list the information which starting form "A" to "B"
> this works fine on all OS
>
>However,
>case 3)
> if the pStartCode ="A" and pEndCode = "["
> the sql will list the information which starting from "A" to "Z"
> it only work on Window English Version or Traditional Chinese Version.
> BUT, it didn't work on Simplified Chinese Window Version.
>
> I can't use the syntax of ' left(code,1) <="A" ', since the user may input fullname
> to "pStartCode" and "pEndCode"
>
> SO. pls Help..
>
>Thanks
>From Agnes
Agnes,
Have a go at both possible solutions and see whether they work.
Difficult for me to test since I do not have access to chinese
solution 1)
pStartCode = 'A'
pEndCode = 'Z'
select * ;
from companytable ;
where ( companytable.code between pStartCode and padr(rtrim(pEndCode), len(companytable.code), 'z') )
solution 2)
pStartCode = 'A'
pEndCode = 'Z'
select * ;
from companytable ;
where ( companytable.code between pStartCode and pEndCode + chr(255) )
Gregory