Formatting numbers (1 Viewer)

VegaLA

Registered User
Joined
Jul 12, 2006
Messages
101
Hi all,
I am trying to format three fields to write to a table.
For reasons unknow they are created as text so I tried using Cint, Clng and cdbl to export thee fields as numbers so when they are exported to an excel spreadsheet they are as number fields.
This actually works for exactly that but the end result knocks off the leading zero if the value is 0910 it ends up as 910. The source table it pulls this from actually has the leading zero if the length is less then 2.
How do I get to format the fields to numbers but keep the exact value ?

Any help is greatly appreciated.

Mitch.....
 

RuralGuy

AWF VIP
Joined
Jul 2, 2005
Messages
13,824
You would have to leave the field as a string. As you know, leading zeros are not significant in numbers. The same is true for trailing zeros after the decimal point in a number.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom