How can I quickly tweak an Access 97 query in SQL or design view so that the output has an unbound number column which gives a consecutive number-count for all the rows in the output (1,2,3,4...etc.)?
It would really help to have some starting SQL to work from. Generically, you could use something like:
SELECT tblA.*,
(SELECT Count(*) + 1
FROM tblA A WHERE A.ID<tblA.ID) as RowNum
FROM tblA;
This is working for selecting all records with the *, but not for when you have a Where clause limiting your output. I've tried some functions I found online, but no success yet. It's someone else's db and the SQL is way too hairy - your generic format is better here. Thanks a lot for this input. If you know how to get 1, 2, 3, 4, etc. when there's a Where clause, that would be great.
I'll take the report method and be happy. Very happy. I'm working on it right now, and will not complain if you give me the answer before I figure it out.
Got it: cntrl source prop set to =1, running sum set to Over All. I knew I'd seen this in some else's report before. Your nudge is just what I needed. Thanks.
The syntax is very generic. If you want them sequentially, you must have a field that identifies the sequence. The example uses a field named "ID".
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.