Feb 26, 2008 #1 meagain MIS Joined Nov 27, 2001 Messages 112 Location CA I'm looking for a formula to use in an update query which will remove the last 3 characters in a string of variable length. Thank you!!
I'm looking for a formula to use in an update query which will remove the last 3 characters in a string of variable length. Thank you!!
Feb 26, 2008 #2 JerryKlmns IS-IT--Management Joined Feb 7, 2005 Messages 2,062 Location GR Take a look at Left() and Len() build-in functions Upvote 0 Downvote
Feb 26, 2008 #3 KenReay Programmer Joined Aug 15, 2002 Messages 5,424 Location GB Update mytable set mystring = left(mystring,len(mysstring)-3); using your tablename and column name of course Regards Ken Reay Freelance Solutions Developer Boldon Information Systems Ltd Website needs upgrading, but for now - http://www.kenneth.reay.btinternet.co.ukUK Upvote 0 Downvote
Update mytable set mystring = left(mystring,len(mysstring)-3); using your tablename and column name of course Regards Ken Reay Freelance Solutions Developer Boldon Information Systems Ltd Website needs upgrading, but for now - http://www.kenneth.reay.btinternet.co.ukUK
Feb 26, 2008 #4 JerryKlmns IS-IT--Management Joined Feb 7, 2005 Messages 2,062 Location GR Although I hate when I steel the joy from discovering new frontiers, Code: UPDATE yourTableName SET yourFieldName = Left([yourFieldName], Len([yourFieldName])-3) WHERE Len([yourFieldName])> 3; In case there are only 2 characters in the string of variable length. Upvote 0 Downvote
Although I hate when I steel the joy from discovering new frontiers, Code: UPDATE yourTableName SET yourFieldName = Left([yourFieldName], Len([yourFieldName])-3) WHERE Len([yourFieldName])> 3; In case there are only 2 characters in the string of variable length.