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

Record count

Status
Not open for further replies.

Noah114

Technical User
Mar 31, 2005
59
0
0
US
I have a query that takes the field 'PLAN NAME' and 'SALES' and the purpose of the query is to total sales for the plan name. How do I create a field that will count the records. In other words

PLAN NAME SALES RECORD
I.H.A. $100 1
U.P.M.C. $98 2
TUFTS $96 3

and so forth
 
Code:
Select Count(Record) As NumRecs FROM TableName


Randy
 
I get counts all over the board;

SELECT [Express Scripts Financials tbl (#4)].[PLAN NAME], Sum([Express Scripts Financials tbl (#4)].SALES) AS SumOfSALES INTO [Top 20 Plans Reference tbl]
FROM [Express Scripts Financials tbl (#4)]
GROUP BY [Express Scripts Financials tbl (#4)].[PLAN NAME]
ORDER BY Sum([Express Scripts Financials tbl (#4)].SALES) DESC;
 
Simply add an AutoNumber field in [Top 20 Plans Reference tbl] after you've run your MakeTable query.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Leslie, I guess the OP wants a ranking method ...
 
I guess I can see that now that you've pointed it out.....

les
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top