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

increment count number of systems 1

Status
Not open for further replies.

JERD1074

Technical User
Jan 29, 2005
10
US
I have a query that lists all of my tickets for each system. i would like to add a numerical field to this query that incrementally counts the number of tickets per system...

ie.

TicketNum SysCount System
15478 1 SAT
15494 2 SAT
15497 3 SAT
15521 1 ARC
15525 2 ARC

Thanks for any help provided.


 
Can you please post the expected result from your sample input ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
that is the expected result...

what i have now, is just the TicketNum column and the System column.

TicketNum System
15478 SAT
15494 SAT
15497 SAT
15521 ARC
15525 ARC

would like to add the count per system column
 
Something Like this ?
SELECT A.TicketNum, Count(*) AS SysCount, A.System
FROM qryTickets AS A INNER JOIN qryTickets AS B ON A.System = B.System AND A.TicketNum >= B.TicketNum
GROUP BY A.TicketNum, A.System;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
this was perfect PHV!
exactly what i needed.

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top