Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL How UPDATE .. WHERE ..=Integer
Message
De
25/02/2003 13:44:55
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL How UPDATE .. WHERE ..=Integer
Divers
Thread ID:
00757703
Message ID:
00757703
Vues:
43
Hello all VFP-SQL Professionals,

I wont change the price for some area in the ArtTab.dBF.
The area is the first two numbers of the ArtNo.

ArtTab.dBF
*+------+-----------+-------+
*|cArtNo|cText |nPrice |
*|c(6) |c(20) |n(10,2)|
*+------+-----------+-------+
*|110001|Shirt blue | 10.00|
*|110002|Shirt red | 10.00|
*|11....|Shirt .... | 10.00|
*|119999|Shirt .... | 10.00|
*|120001|Sweet blue | 12.00|
*|129999|Sweet .... | 12.00|
*|130001|Socks white| 3.00|

If the Fieldtype from ArtNo is character it is easy.
UPDATE ArtTab SET nPrice=9.00 WHERE SUBSTR(cArtNo,1,2)="11"
UPDATE ArtTab SET nPrice=2.90 WHERE SUBSTR(cArtNo,1,2)="13"

But unfortunately, my ArtNo is INTEGER (iArtNo).
I test this command, but VFP SQL don't like this technique.
UPDATE ArtTab SET nPrice=9.00 WHERE SUBSTR(STR(iArtNo),1,2)="11"

Can anyone help with the right SQL command for UPDATE.

Many thanks from me.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform