Leading zeros in a field

lp4799

New member
Local time
Today, 06:27
Joined
Dec 3, 2001
Messages
6
I have to work with two tables to run a query. The first table has a field titled QUAL_TRK_NO, but the way the data appears in the field is as follows: 00000000000000000000000000000002721897
(leading zeros)

The second table has a field titled KEY_INFO. This field contains the same data as the QUAL_TRK_NO, but the data appears in the following format: 2721897.

(It's the same number, but in a without the leading zeros)

Right now, if I join the tables and run a query, there is no data returned. I need to prepare a query using the two tables to retrieve other data from the tables, but this field is the one field that the two tables have in common.

The tables I use are on a network, so I don't maintain the data. How can I get both of the fields to match up and allow the query to run?

Please help! Thanks.
 
Use in your query the RIGHT function. (more information is available from the HELP files)


=Right([fieldname],7)

Hope that helps. Good luck to you.
 
If the length of the significant digits is not always the same, you can convert both fields to long integers using the CLng() function.
 

Users who are viewing this thread

Back
Top Bottom