Query result to textfile with fixed format

RV

Registered User.
Local time
Today, 18:03
Joined
Feb 8, 2002
Messages
1,115
Hello,

I need to transfer the results of a query to a textfile.
The query is based on three columns namely Familyname, City and Accountnumber.
The format of the textfile is predefined.
The (first) value for Familyname should be in the first line of the textfile.
The (first) value for Accountnumber should be in the third line of the textfile.
This repeted for all records selected by the query.

How can I realize this ?

RV
 
The easiest way to achieve this is to build a report in the format you want:

Name
City
A/C

Then export it to Word then do a saveas in Word and choose 'Text Only' as the filetype.

When I tried doing this by doing File-SaveAs in the report preview the text file wasn't correctly formatted.

You can do it in code but my way is absolute painless on the noggin.

Ian
 
Ian,

thanks.
MS Word will not be used as a "go between".
So I guess I'll need some code.
The format of the textfile is predefined:

Let's say this is the result of a query:

FamilyName City AccountNumber
Visser AMSTERDAM 123456789
Jansen ZWOLLE 112233445
Jacobs ROTTERDAM 224466889

I would like to output this result to a textfile like this:

Visser (filled up to position 25 with zeros)
AMSTERDAM (filled up to position 25 with spaces)
123456789 (followed by ten zeros)
Jansen (filled up with....)
ZWOLLE (filled up to ....))
112233445 (followed by ...)
JACOBS (filled up to .....)
ROTTERDAM (filled up to ....)
224466889 (followed by ....)

Perhaps there's a way to first write the query results to a temp table and then export to the textfile ?

TIA,

RV
 
Still looking for clues.....
Is there someone out there who can help?

RV
 

Users who are viewing this thread

Back
Top Bottom