View Single Post
  #3 (permalink)  
Old March 7th, 2006, 06:23 PM
mat41 mat41 is offline
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

If you are inserting into an integer field you dont need '" "' You need " " Eg:

SQL = "UPDATE Item SET Qty = " & cint(trim(newQTY)) & ", AveragePrice = '" & trim(newAverage) & "' WHERE ItemID = '" & itemID & "';"

Its a good habbit to use the trim function in you sql and use a trailing semi colon (as you can see above)

What data type is the field ItemID? Once agin you have '" "' if this is an integer remove the single quotes Eg:

SQL = "UPDATE Item SET Qty = " & cint(trim(newQTY)) & ", AveragePrice = '" & trim(newAverage) & "' WHERE ItemID = " & itemID & ";"



Wind is your friend
Matt
Reply With Quote