-
Access Query
Quick question, I have a table in access where I need to verify if a certain field contains 12 characters, and if it does, cut off the last 4 characters. What would be the best way of doing this using an Access Form?
I tried doing a recordset thing but I'm not sure how to connect to the local provider instead of specifing the file name again.
So this has to be in access, I can't use VB6 for this one (long story)
-
Code:
select iif(len([table].[field])>11,left([table].[field],len([table].[field])-4,[table].[field]) as TrimmedField
From table
Something like that? This is in the query, but you could put it into code if you need to.
iif - instant if
len - length of field
left - left side of field
Vince
-
Thanks a bunch, thats exactly what I was looking for!