Question : Remove leading zeros

I am using the function "val" to get rid of leading zeros in access hgowever some results look like this:

4.79150389184847E+14

However the majority are fine, is there any other function that will stop this happening?

Thanks

Matt

Answer : Remove leading zeros

Matt, u said your field contains non numerics therefore what u have is a string which contains numbers.
With that string u want to remove leading zeros. Therefore you cannot use VAL

The function by Raynard should solve it for you. Place his code in a module somewhere

With access, u can use vba functions in a query

so example query

UPDATE table
SET myfield = removeLeadingZeros(myfield)


where table is the name of the table u want to name
and myfield is the column in the table u want updating

Always backup DB first before trying something new like this

Random Solutions  
 
programming4us programming4us