query that selects based upon number of characters

J

Jennifer K.

I have a field that can be up to 4 characters such as:

C619
A52
C343
C32

I would like to select the records that have only 3 characters and would
give me only the records such as A52 and C32 in the results.

Thanks!
Jennifer
 
R

raskew via AccessMonster.com

Hi -

Here's an example query with table Nums and field Num:

SELECT Nums.Num
FROM Nums
WHERE (((Len([num]))=4));

Change the table and field names and copy/paste to a new query.

HTH - Bob
 
J

John Spencer

Use criteria of
LIKE "???"
against the field.

Or use a calculated field to get the length the field's content.

Field: FldLength: Len([Your Field])
Criteria: = 3

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
Top