removing leading zeros (1 Viewer)

phamyh

Registered User.
Local time
Today, 12:07
Joined
Oct 29, 2008
Messages
19
How to I do a query to match numbers but exclude the leading zeros?

I have 2 tables that i'm doing an equal join to. The 2nd table has leading zero to the numbers so it's making it difficult for me to find any matches.

ex

table 1 table 2
12345 012345

But not all numbers on these columns have a leading zero so I can't do a trim. What should i do?

Thanks!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 09:07
Joined
Aug 30, 2003
Messages
36,133
You could try adding CLng() around both fields in the join.
 

phamyh

Registered User.
Local time
Today, 12:07
Joined
Oct 29, 2008
Messages
19
Thank you!! This forum has always been a great resource for me!!
 

Users who are viewing this thread

Top Bottom