
January 11th, 2004, 09:42 AM
|
|
Registered User
|
|
Join Date: Jan 2004
Location: Florida
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Single SQL stmt in asp
Please help. I currently have an .asp page that take way to long to complete because of my sql. Currently I am executing 3 stmts with a do/loop to get this data. I would like to count how many records are Y, but only if the latest entry for that person is a Y.
DB: Fields - RecNo (Unique), UserNo (Unique to user), Agreed.
RecNo UserNo Agreed
1 111 Y
2 222 Y
3 111 N
4 333 Y
5 111 Y
6 444 Y
7 444 N
8 333 N
9 555 Y
10 222 N
Results should be 2 - User 111 and 555. This is a large db and getting biggier. There's probably a way to declare var in a procedure and possibly if stmts, but I just can't figure it out. Thanks is advance.
|