Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

criteria in a query 2

Status
Not open for further replies.

joeythelips

IS-IT--Management
Aug 1, 2001
305
IE
Hi,

I want to return only numbers that are 9 digits long, and also want to eliminate dates from the same filed.

Anyone any ideas?
 
Thanks for that.
However I am getting a message saying "invalid use of null" wheni run the query??
 
Probably can't convert null to a string. Try Len(Cstr(Nz([Field Name])))=9
 
Add a column to your query by putting this in the "Field:" row of the QBE:

FieldLength: Len(Cstr(Nz([MyFieldName])))

Now you'll have a new column that shows the character length of every value in MyFieldName. Now in the criteria down below FieldLength, type in 9 so that you only get values where MyFieldName is 9 characters long. Since a date is not 9 characters long, it won't be returned.

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top