Carriage Return (1 Viewer)

akb

Registered User.
Local time
Today, 11:33
Joined
Jul 21, 2014
Messages
57
When using the carriage return how do I format the data so it will export with 2 decimals?

In the example below I need the Estimated Material Cost to export in in format: 500.00 --- NOT 500.

MTLCost: [Estimated Material Cost] & Chr(13) & Chr(10) & [C]

I appreciate your help.
 

jdraw

Super Moderator
Staff member
Local time
Today, 12:33
Joined
Jan 23, 2006
Messages
15,423
Export in what format?(csv, tab delimited..) The decimals are not affected by the carriage return/line feed.
How is estimated material cost defined/dimmed?
What is the & [C]?

You could try
MTLCost:Format( [Estimated Material Cost],"Currency")
 

akb

Registered User.
Local time
Today, 11:33
Joined
Jul 21, 2014
Messages
57
.txt format.

It seems that the decimals are affected. I do not want it to export in currency format because I do not want the $ to export.

The C is needed - this is the format I am exporting:

*,4365
C,76,,MTL,11042014,,,25
C,76,,MSC,11042014,,,2761
C,76,,LBR,11042014,,60.00,4000.00
 

jdraw

Super Moderator
Staff member
Local time
Today, 12:33
Joined
Jan 23, 2006
Messages
15,423
Try
MTLCost:Format( [Estimated Material Cost],"#,##0.00")
based on this example from techonthenet

Format (210.6, "#,##0.00")
Result: '210.60'
 

jdraw

Super Moderator
Staff member
Local time
Today, 12:33
Joined
Jan 23, 2006
Messages
15,423
Error message? What value did you try? What format resulted?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 17:33
Joined
Sep 12, 2006
Messages
15,755
what are you doing with the text file afterwards, and how are you exporting it?

access always makes its own decisions with regard to exports/imports, and can do things like dropping dps greater than 2

you may have to iterate the query, and write the text file manually


this sort of pseudo code

Code:
 while not qry.eof
     process to export line
     next item
 wend
 

akb

Registered User.
Local time
Today, 11:33
Joined
Jul 21, 2014
Messages
57
I did not receive an error message.

I am importing the .txt file into our accounting software.

I export by selecting export data to .txt file.

How do I incorporate the code you mentioned below?
 

akb

Registered User.
Local time
Today, 11:33
Joined
Jul 21, 2014
Messages
57
Also, is there a way to insert a carriage return without the comma?
 

Users who are viewing this thread

Top Bottom