Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL How UPDATE .. WHERE ..=Integer
Message
From
25/02/2003 13:44:55
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL How UPDATE .. WHERE ..=Integer
Miscellaneous
Thread ID:
00757703
Message ID:
00757703
Views:
38
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.
Next
Reply
Map
View

Click here to load this message in the networking platform