Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql problem in different language OS
Message
De
01/08/2002 08:20:57
 
 
À
01/08/2002 07:03:16
Agnes Cheng
DynamicTech Consultants Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00684877
Message ID:
00684900
Vues:
30
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform