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!

Length 1

Status
Not open for further replies.

nickotine

Programmer
Nov 27, 2001
23
GB
I have a field which I need to remove the last 2 characters from. I.E. 123h456789d-C1#* this needs to read 123h456789d-c1

I have tried Trim and Left to no avail.

Help Please.

Nickotine.
 
Try something along the lines of

left(fieldname,length(fieldname)-2)

 
Hi thanks for the reply, I did forget to mention that the field i need to remove the last 2 characters is a varable length.
 
That will still work. you just nee dot do something to avoid 0,1 or 2 character fields such as
if length(fieldname) > 2 then code here

 
Thanks for the help finally got it to work.

Cheers,

Nickotine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top