jad0083
asked on
Enumerate Results in SQL Query?
Is there any clean way to enumerate the results of an SQL query in a listbox? The main reason for asking this is that I need a way to count the row/results so if I sort them, the row number is consistent. Thanks in advance^
strlist2 = "SELECT (SELECT Count(ID) FROM Assignments WHERE [Associate_name] = '" & assoc_ind & "' AND " & _
"Month([Assignment_Date]) = Month(Now())) as Count_rec, Assigned_to, [Number], [Type], [Assigned_by], [Assignment_Date] FROM Assignments " & _
"WHERE [Associate_name] = '" & assoc_ind & "' AND Month([Assignment_Date]) = Month(Now()) ORDER BY 6;"
ASKER
Uhm, I already have that variable as the rowsource of the listbox. Problem is that on one of the columns of the listbox, I would want to have an enumeration:
Something like this:
Enumeration | Count | Assigned_to | Number | Type | Assigned_by | Assignment_Date
1 3 joe 5 P sam 10/06/08
2 2 jack 4 A bill 10/04/08
3 7 Dude 3 C Frank 10/08/08
4 1 Paul 8 B Steve 10/10/08
Thanks!
Something like this:
Enumeration | Count | Assigned_to | Number | Type | Assigned_by | Assignment_Date
1 3 joe 5 P sam 10/06/08
2 2 jack 4 A bill 10/04/08
3 7 Dude 3 C Frank 10/08/08
4 1 Paul 8 B Steve 10/10/08
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
me.listbox.rowsourcetype="
me.listbox.rowsource=strli