query for fields with just nine numeric digits

stirlsa

Board Regular
Joined
Sep 17, 2004
Messages
216
In a query I want to search for data in a text field called MEDSID within a table called CLIENT.

I want to search for records in which MEDSID field has 9-digits only of all numeric text.

Is there any way to do so?

Thanks in advance for any adivce.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
If it's a text field you can use the len() function to return the number of characters.

Code:
SELECT * FROM CLIENT WHERE len([MEDSID]) = 9;

hth,
Giacomo
 
Upvote 0
hope this helps

create a new variable in your query called character numbers : use the character number function, use help to find it, this should give you the answer of the number of characters , select 9 in that field then filter with a parameter query in your search field.

:biggrin:
 
Upvote 0

Forum statistics

Threads
1,214,618
Messages
6,120,544
Members
448,970
Latest member
kennimack

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