Truncate last Character if its "/"

Jimee

Registered User.
Local time
Today, 18:18
Joined
May 4, 2001
Messages
21
I have a statement in an update query that I have gathering some data frm a table. I'd like to get the first 16 characters and if the last on is a "/" remove the "/" how is this done. Here is the statement:

UPDATE ElecTrayFitting SET ElecTrayFitting.Name = Left([ElecTrayFitting.Name],16);




Thanks,
Jimee
 
UPDATE ElecTrayFitting SET ElecTrayFitting.Name = IIF(Right([ElecTrayFitting].[Name],1)="/",Left([ElecTrayFitting].[Name],15),Left([ElecTrayFitting.Name],16));

And you should change the field name from NAME because that is an Access Reserved Word and a particularly nasty one at that. It will cause you all sorts of grief if you do not change it because everything in the database has a .Name property and sometimes, even with the square brackets, it will choke on it.
 
That did it. Thanks bunches!!!!!!!
 

Users who are viewing this thread

Back
Top Bottom