Export count(*), then the records to a txt file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I currently am running a transferText Macro that calls a existing query that
selects 7 fields from each record in a database table and exports the data to
a text file.

I would like to include on the first line of the file a Count(*) of how many
records are in the table.

I was thinking that there are 2 ways to approach it. Modify the query to
first select the Count(*), then do the normal select.

Or Run 2 transferText actions in the macro, where the 1st does the count(*)
& the 2nd transfertext action APPENDS all the tables records onto the end of
the text file that contains the Count(*) value.

Would greatly appreciate any suggestions out there to these 2 courses of
action or a new suggestion.

Thanks in Advance
 
kahunaVA said:
I currently am running a transferText Macro that calls a existing query that
selects 7 fields from each record in a database table and exports the data to
a text file.

I would like to include on the first line of the file a Count(*) of how many
records are in the table.

I was thinking that there are 2 ways to approach it. Modify the query to
first select the Count(*), then do the normal select.

Or Run 2 transferText actions in the macro, where the 1st does the count(*)
& the 2nd transfertext action APPENDS all the tables records onto the end of
the text file that contains the Count(*) value.

Would greatly appreciate any suggestions out there to these 2 courses of
action or a new suggestion.


I seriously doubt that you really need the count in the
first record, but I guess that's neither her nor there.

You can get that result by creating another query to use in
the export operation:

SELECT Count(*) As f1, Null As f2, Null As f3, etc
FROM yourquery
UNION ALL
SELECT f1,f2,f3,etc
FROM yourquery
 

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

Back
Top