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

shared Result

Status
Not open for further replies.

istone

IS-IT--Management
Jan 24, 2007
139
US
Hi,
Customers1.[Account Exec], Customers1.[Life Exec], Customers1.[CHRD Exec], Customers1.[Pension Exec], Count(*) AS TheCount INTO 1
FROM Customers1 INNER JOIN Contacts ON Customers1.[Client key] = Contacts.[Client ID]
GROUP BY Customers1.[Account Exec], Customers1.[Life Exec], Customers1.[CHRD Exec], Customers1.[Pension Exec], Contacts.Code2
HAVING (((Contacts.Code2) Like -1));

The above query gives me this result:

Acc Exec Life Exec CHRD Exec Pension Exec The Count
AC 8
AC NJ 6
AC BM 3
CM BT 2
CM BM NJ 6

I would like to see the following result:

Acc Exec Life Exec CHRD Exec Pension Exec The Count

AC NJ 9
CM BM NJ 8

AC is shared twice so total = 9 and CM is also shared twice which = 8. the firest AC which equal 8 is alone.
I hope I am not confusing you.
thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top