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

Need Help With Count Of Records 1

Status
Not open for further replies.

bistro7

Technical User
May 7, 2002
13
US
I am trying to count the records in a query:
ID WQ_ID RecordNumber
1 299704 1
2 299704 2
3 299705 1
4 299705 2
5 299706 1
6 299707 1
7 299707 2
8 299707 3
9 299707 4
The RecordNumber is what I am trying to pull, but I am having problems. Any help would be great!
 
Skip thanks for your help. This worked.
 
You wanted a ranking query like this ?
SELECT A.ID, A.WQ_ID, Count(*) AS RecordNumber
FROM someTable AS A INNER JOIN someTable AS B ON A.WQ_ID = B.WQ_ID
WHERE A.ID >= B.ID
GROUP BY A.ID, A.WQ_ID

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top