Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am pulling information from an Ac 1

Status
Not open for further replies.

mdctsg

MIS
May 26, 2002
102
US
I am pulling information from an Access 2000 db to a csv file. In one of the tables (Shipment) the cost and weight fields I need to change the formatting of the numbers. I cannot alter the db so I pull it out in a csv. My problem is the numbers in the cost and weight fields are not set up the way I need them to be Example:
Cost shows 775 instead of 7.75, and 1125 instead of 11.25 the weight field shows 250 instead of 25 and 100 instead of 10. In other words it adds a zero to the end. Is there any way I can fix this before or during the time I export it. Once it exports it goes to a free file where ever the user sends it.
Hopefully I have explained it enough. Could someone please help me with this

Thanks
Bob
Here is the statement I use to pull it out

"SELECT Orders.OrderNo, Shipment.Cost, Shipment.Weight FROM Orders, Shipment, WHERE Orders.m_primaryKey = Shipment.m_foreignKey00"
 
Looks like you want to adjust the numbers using a simple math formula. If this is true for all values in the field then it should be simple.

Try

"SELECT Orders.OrderNo, (Shipment.Cost/100) as Expr1, (Shipment.Weight/10) as Expr2 FROM Orders, Shipment, WHERE Orders.m_primaryKey = Shipment.m_foreignKey00" Thanks and Good Luck!

zemp
 
Thanks that worked great. I have another question. Is it possible to format that cost column as a number with two decimal places. The cost comes out on the even numbers as 14 instead of 14.00

Thanks for your help
Bob
 
You can use the format funtion to take care of this.

Try,

newValue=Format(Value,"#,###,##0.00") Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top