Click to See Complete Forum and Search --> : SQL 123
rezania
Sep 7th, 2000, 05:56 AM
Hi
I get many rows of info from a table using a SQL Select statement,I just want to put a row number by the side of each resulting row, like:
1 jim
2 john
3 joe
4 james
5 ...
sounds simple, but... How?
Also any comments on how to print row numbers in DataReport would be nice.
Thanks
JHausmann
Sep 7th, 2000, 12:21 PM
Why would you want to?
rezania
Sep 12th, 2000, 10:25 AM
Hi again
The user wants me to print it!
JHausmann
Sep 12th, 2000, 11:37 AM
The problem is, it's meaningless unless the data (row number) is stored.
AKA
Sep 13th, 2000, 05:16 AM
If your record set is ordered by something for example name. Then it could look like this
SELECT
Name,
( SELECT
COUNT( * )
FROM
tblName N2
WHERE
N2.Name <= N1.Name
)
FROM
tblName N1
ORDER BY
Name
GROUP BY
Name
Might not be the best but it at least pops your thread to the top.
rezania
Sep 15th, 2000, 01:43 PM
Hi
After Hitting my head on the wall for so many times, I have found that I could add a column to my recordset using Shape ... Append command with the NEW option, and then fill it with row numbers in a loop.
Thanks
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.