A query to discover the number

DRANDON

Active Member
Joined
Jun 30, 2006
Messages
268
All, I am in Access and need a way in a query discover if all of my 5 characters are text, then delete the record. I could have values such as "E3MTH" or "DOS6P", but if my query comes across a value that is like "DTHRS" delete the record. I was thinking something like

iif(and(Not Numeric(Mid([CPT],1),Not Numeric(Mid([CPT],2),Not Numeric(Mid([CPT],3),Not Numeric(Mid([CPT],4),Not Numeric(Mid([CPT],5))

I will be trying this out in Access tomorrow but I thought I would throw this out to my favorite forum for ideas. Thanks so much in advance.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You could use Like perhaps.

UCase([CPT]) Like "[A-Z][A-Z][A-Z][A-Z][A-Z]"
 
Upvote 0
OK as long as you only ever have 5 characters in the field value. Otherwise, you might want to use a sub or function to evaluate each character.
 
Upvote 0

Forum statistics

Threads
1,214,634
Messages
6,120,659
Members
448,975
Latest member
sweeberry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top