View Full Version : Leading Zeroes Help!


Venom
11-28-2007, 09:29 AM
Hi

I have a table called "Amount" that has the amounts as follows: 45.40, 35.60 etc.

I need to add 5 zeroes to the start of each individual amount so this can be imported into another system (E.g 0000045.40, 0000035.60 etc).

Can anyone please help with how to do this?

I currently have the format as Currency and it is exporting the £ symbol when I am choosing to export as a fixed width txt file. When I change the format to number, it is rounding the values up/down which I do not want it to do!

Thanks for any advice.

Venom.

KeithG
11-28-2007, 09:35 AM
In a query create a field like below

ExportField: "00000" & Cstr([CurrencyfieldName])

Venom
11-28-2007, 01:58 PM
thanks KeithG - there are some amounts that are 0.00 and must also be in the same format (e.g 0000000.00) - these are just showing as 00000. how can I amend this?

also, is there any simple way to add that new column produced by the query to the existing table?

edit: when the amount is over 99.99 (e.g 130.99), i need it to lose a zero so it is still fixed width of 10 (e.g 0000130.99) - any tips?

thanks again.
Venom.

Guus2005
11-29-2007, 02:47 AM
Use the format statement
ExportField:Format(Cstr([CurrencyfieldName]),"000000.00")

Venom
11-29-2007, 08:49 AM
Use the format statement
ExportField:Format(Cstr([CurrencyfieldName]),"000000.00")

wizard!! thanks for all your help guys! :)