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

Get record counts from table - must be easy! 1

Status
Not open for further replies.

addy

Technical User
May 18, 2001
743
GB
OK

I have two tables, call then T1 and T2.

T1 has the following fields:

DossNo
DossRmk
DossPg

T2 has the following fields:

DossNo

In T1, DossNo is repeated for differing values of DossRmk and DossPg.

In T2 there are unique Values of DossNo, each of which appears in T1 - but does not contain all values of DossNo from T1.

What I need is a count of how many records there are in T1 for each value of DossNo whcih appears in T2.

I'm just having a brain craze day today and am not sure where to start.

Any ideas?

Thanks.
 
Something like this (SQL code) ?
SELECT T1.DossNo, COUNT(T2.DossNo)
FROM T1 LEFT JOIN T2 ON T1.DossNo = T2.DossNo
GROUP BY T1.DossNo

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

Part and Inventory Search

Sponsor

Back
Top