DebbieDavis
Programmer
I've looked for a similar answer to my problem but can't seem to find anything that works. I have the following query:
What I need to do is group by a field call affid, then count by the number of records per affid. But when I group, etc. there are too many fields to group on so I don't get a proper count... I don't know how to do a nested query. I hope this makes sense. Thanks for any thoughts you have.
Code:
SELECT *
FROM dbo.customers LEFT OUTER JOIN
dbo.gifts ON
dbo.customers.contactid = dbo.gifts.giftcustomerid
WHERE (dbo.customers.expanded IS NOT NULL) AND
(dbo.customers.unsubscribe IS NULL) AND
(dbo.customers.dist IS NULL)
What I need to do is group by a field call affid, then count by the number of records per affid. But when I group, etc. there are too many fields to group on so I don't get a proper count... I don't know how to do a nested query. I hope this makes sense. Thanks for any thoughts you have.