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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show sequential count along with data

Status
Not open for further replies.
Jul 17, 2003
66
US
I am trying to use an access query to create a comma delimited text file. I need to include a sequential line number with each record.

My current query is like:

select field
from table

My output from this is like:

field_data
field_data
etc.

But I need my output to look like:

1 field_data
2 field_data
3 field_data
and so on.


Hope I explained this OK. Thanks for the help....
 
You need to include an AutoNumber type field to your table. This is often used as the Primary Key as it will never have duplicates.

Add this new field and each record will have an auto-incrementing number assigned to it.

HTH
 
no, you don't have to alter your table. There are quite a few threads that show how to get a counter in your query. Search the forum and I'll keep my eyes open. If I can find one, I'll post a link.



Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top