Trim leading 0's in Query?

chris-uk-lad

Registered User.
Local time
Yesterday, 19:59
Joined
Jul 8, 2008
Messages
271
Hi all,

I have a table that is supposed to contain 7 character values however some are 6, and some are 12. The 6 character values dont bother me but the 12 character values are the 7 character correct values with 5 leading zeros.

Anyway i can trim this? there should be no 0's at the start of any of the values.
e.g
to: 1234567
from: 000001234567
 
You can use an update query to remove them, use something like CDbl or CLng to trim any leading zero's
 
Hi,

How is that data getting into your table? If the data is being supplied from an external source file, then you can upon importing remove the leading zero's, if it's being entered directly into your database, then I would suggest addressing the issue at that point.

John
 

Users who are viewing this thread

Back
Top Bottom