|
-
Nov 1st, 2002, 05:52 AM
#1
Thread Starter
Hyperactive Member
sql count by company
i want to return a count of the number of lproductid's for each company, so far i have this query
select count(lproductid), companyname, customeragreementsent, customeragreementback
from tblcompanies
inner join tblCustomerAgreements as ca on tblcompanies.companyid = ca.companyid
inner join tblallsubscribercodes as tas on ca.companyid = tas.companyid
inner join ilabelserver.dbo.subscriber as isub on tas.subscribercode
= isub.smanucode
inner join ilabelserver.dbo.product as iprod on isub.lsubscriberid =
iprod.lsubscriberid
where customeragreementsent is not null and customeragreementback is null
group by lproductid, companyname,customeragreementsent, customeragreementback
but this does not pull back the correct results.
can anyone help?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|