Transfer Text

N

NetworkTrade

Access03; have working button with:
DoCmd.TransferText acExportDelim, , "EXP2-a", "C:\TxtTEST.txt"

EXP2-a is a Aggregate query (sum)

Questions:
1. one field is a date; when query shows 08/01/2008 the txt file is
displaying 39661 when the query shows 07/31/2008 the txt file is
displaying 39660 . It is displaying an absolute value counting from a system
start date I guess. How do I get this as the date format?

2. all the fields are 'GroupBy' except for one which is SUM. This one
displays in the query as 48 but in the txt file as 48.00 - - - pretty minor
but can this be changed?....perhaps in the table parameters maybe

....just surprised to see the txt file differ from the query result in these
two...

3. the Docmd will need ultimately to have dynamic path / file name in the
string based on values in txt boxes in Form1. What is correct syntax to
inset?
" ' " Forms!Form1.PathName" ' " ??

thanks in advance for input
 
J

John W. Vinson

Access03; have working button with:
DoCmd.TransferText acExportDelim, , "EXP2-a", "C:\TxtTEST.txt"

EXP2-a is a Aggregate query (sum)

Questions:
1. one field is a date; when query shows 08/01/2008 the txt file is
displaying 39661 when the query shows 07/31/2008 the txt file is
displaying 39660 . It is displaying an absolute value counting from a system
start date I guess. How do I get this as the date format?

Correct analysis! Date/Time values are stored as a count of days and fractions
of a day (times) since midnight, December 30, 1899. For TransferText use a
query with a calculated field explicitly formatting the value:

ExpDate: Format([fieldname], "mm/dd/yyyy")
2. all the fields are 'GroupBy' except for one which is SUM. This one
displays in the query as 48 but in the txt file as 48.00 - - - pretty minor
but can this be changed?....perhaps in the table parameters maybe

Again use the Format.
...just surprised to see the txt file differ from the query result in these
two...

They just do.
3. the Docmd will need ultimately to have dynamic path / file name in the
string based on values in txt boxes in Form1. What is correct syntax to
inset?
" ' " Forms!Form1.PathName" ' " ??

DoCmd.TransferText acExportDelim, , "EXP2-a", Forms!Form1.PathName
 
N

NetworkTrade

aha ...much thanks Mr. V.
--
NTC


John W. Vinson said:
Access03; have working button with:
DoCmd.TransferText acExportDelim, , "EXP2-a", "C:\TxtTEST.txt"

EXP2-a is a Aggregate query (sum)

Questions:
1. one field is a date; when query shows 08/01/2008 the txt file is
displaying 39661 when the query shows 07/31/2008 the txt file is
displaying 39660 . It is displaying an absolute value counting from a system
start date I guess. How do I get this as the date format?

Correct analysis! Date/Time values are stored as a count of days and fractions
of a day (times) since midnight, December 30, 1899. For TransferText use a
query with a calculated field explicitly formatting the value:

ExpDate: Format([fieldname], "mm/dd/yyyy")
2. all the fields are 'GroupBy' except for one which is SUM. This one
displays in the query as 48 but in the txt file as 48.00 - - - pretty minor
but can this be changed?....perhaps in the table parameters maybe

Again use the Format.
...just surprised to see the txt file differ from the query result in these
two...

They just do.
3. the Docmd will need ultimately to have dynamic path / file name in the
string based on values in txt boxes in Form1. What is correct syntax to
inset?
" ' " Forms!Form1.PathName" ' " ??

DoCmd.TransferText acExportDelim, , "EXP2-a", Forms!Form1.PathName
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top