Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cut off digits

Status
Not open for further replies.

samotek

Technical User
May 9, 2005
197
BG
I have a table called table2 and texts in the field "grade".Is it possible through a code to cut the last digits from the row and paste them in the other field called "price"? For for example in the row
Pento Super Performance III 5W-30 12 x 1 L 3,74
Pento Super Performance III 5W-30 3 x 5 L 17,60

to cut the digit 3,74 or 17,60 and paste them in the field price.And after that to delete the letter L ?

 
Sam,

Create a new query and paste this into the SQL screen:
[tt]
UPDATE table2 SET table2.price = Mid([grade],InStr([grade],"L")+2), table2.grade = Left([grade],InStr([grade],"L")-2);
[/tt]
Run the query and it will perform the changes as you have stated.

This of course relies on the fact that EVERY record has 'L' in the grade string - no 'L' and it won't work for that record.

ATB

Darrylle

Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top