|
-
Aug 10th, 2004, 02:55 AM
#1
Thread Starter
Frenzied Member
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)
NXSupport - Your one-stop source for computer help
-
Aug 10th, 2004, 03:01 AM
#2
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
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Aug 10th, 2004, 03:19 AM
#3
Thread Starter
Frenzied Member
Thanks a bunch, thats exactly what I was looking for!
NXSupport - Your one-stop source for computer help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|