Solved Query only show records when a fields data is more than 10 numeric numbers

Number11

Member
Local time
Today, 21:20
Joined
Jan 29, 2020
Messages
623
So i need to filter a query and only show when the product number is less than 12 numeric numbers, i have tried to use the

Expr1: Len([ProductID])

Criterial set as <12

but this doesnt work
 
how about:

Expr1: Len(Trim$([productID] & ""))
Criteria:<12
 
Len() isn't going to work with numeric fields. If the field is numeric, try Len( CStr( [ProductID] ) ) to get the number of digits.
 
Long Interger has a maximum length of 10.
maximum value is 19999999999.
 
Didn't see the "12" right away, read it too fast. Yep, you need TRIM$()

Except wait a minute... are the product IDs stored as strings with explicit leading spaces? Then TRIM$ will work. But what if they are stored with explicit leading zeroes - AS STRINGS? Because in that case, TRIM$ will do nothing.

We need to ask that question about data format before making a blanket statement about how to do this right.

@Number11 - what is the EXACT format of storage for those product ID numbers? (Including details of how they are stored.)
 
Last edited:
So they are just a string of numbers that could be as low as 7 digest and as high as 13 all within a table ProductID = number and then Product Name = Product name like Side Panel, Tap, Lower Rear Panel"
 
Number11,

Always better for focused responses if you supply some sample data and expected results.
 

Users who are viewing this thread

Back
Top Bottom