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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

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