Querying fields with Zeros

velcrowe

Registered User.
Local time
Today, 12:02
Joined
Apr 26, 2006
Messages
86
I have a database where the primary key is a field for pass numbers. Many of the pass numbers begin with zeros (example: 0023456). I changed the table property for the pass numbers to text so the zeros would be recognized. However, I have a form based on a query to search this pass number field. How can I get the query to recognize the pass numbers that begin with zeros. When I put in any other number above zero, the pass number satisfies the query and the employee information pops up. Aside from AllowZeroLength and trying to format the text field, I cannot get the query to recognize the pass numbers that begin with zero. Please help:eek:
 
Change the field back to numeric. Change its format to
0000000

That will show the field with leading zeros but it will not require them to be input.
 
If I would like to enter 000555 in my query parameter box and it recognize the entire number. Can it be done. So far when I enter 555 it will give me 000555, but not when I enter 000555. The query shows no value. How can i get it to recognize the entire zero string.
 
If the field is defined as text, you MUST include the leading zeros whenever you enter the field. If the field is defined as a long integer, you can omit the leading zeros on data entry and you can use the format that I suggested when you display the number so that the leading zeros will show. Numeric values are not stored as strings so leading zeros have no meaning whereas with a text field, they have a great deal of meaning.
 

Users who are viewing this thread

Back
Top Bottom