Link to home
Start Free TrialLog in
Avatar of angie_angie
angie_angie

asked on

How to output a number in standard format while the number is varying in value

I want to write some code like this:
sSQL = "SELECT Format([OrderValue],'0,000.00') As Expr1 FROM..."
then open a recordset to write this value into a Word document.
The problem here is the value of OrderValue changes everytime.
If OrderValue = 500, in Word doc it will be 0,500.00 (extra 0 and comma)
If OrderValue = 4000000, in Word doc it will be 4000,000.00 (lack of one comma)
How to solve such problem?
ASKER CERTIFIED SOLUTION
Avatar of psychic_zero
psychic_zero
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jeffrey Coachman
angie_angie,

<open a recordset to write this value into a Word document>
If you just need to insert this value into a Word Document you can just store it as a Variable and insert it into the text.
Please explain why it must be in a recorrdset to be inserted into a Word Document?

JeffCoachman