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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Substring Command ?

Status
Not open for further replies.

dhrehor

IS-IT--Management
Jun 16, 2005
23
US
Need to truncate a field. Here is what I have:

update PARTS set weight = substring(weight,1, charindex(' ',weight))

Original Field is : 5.36 lbs
Need to make it: 5.36

Need this done throughout the table PARTS.

Thanks

Don
 
The corresponding Access functions are Mid and Instr
Code:
update PARTS set weight = Mid(weight,1, Instr(weight," "))
 
Using the Val function, could perhaps fit here (check it out in the help files), else a combination of InStr and Mid?

mid$(field,1, instr(field," ")-1)

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top