Webboy2008
asked on
sql, classic asp, asp.net
I have the following sql statement working fine with the attached result.
However, when the CountOfTmpRefID = "0", the the whole line will be gone.
How can make it like "ABC" still have 0 showing ? meaning when CountofTmpRefId return null or 0, it still be able to keep all of the list of the agency name?
Thanks
SELECT
COUNT(tblWSBondQuotes.TmpR efID) AS CountOfTmpRefID,
SUM(tblWSBondQuotes.BondAm ount) AS SumOfBondAmount,
SUM(tblWSBondQuotes.GrossP rem) AS SumOfGrossPrem,
SUM(tblWSBondQuotes.Commis sion) AS SumOfCommission,
SUM(tblWSBondQuotes.NetPre m) AS SumOfNetPrem,
Agency.DBA,
tblWSBondQuotes.sAgencyBro ker
FROM tblWSBondQuotes INNER JOIN
Agency_Master ON tblWSBondQuotes.sAgencyBro ker = Agency_Master.Agency_ID INNER JOIN
Agency ON tblWSBondQuotes.sAgencyBro ker = Agency.Agency_ID
WHERE (tblWSBondQuotes.StatusID = @StatusID) AND (Agency_Master.StatusId = 1)
GROUP BY tblWSBondQuotes.sAgencyBro ker, Agency.DBA, Agency_Master.AgencyMaster Id
HAVING (Agency_Master.AgencyMaste rId = @AgencyMasterId)
3-30-2012-6-49-58-PM.jpg
However, when the CountOfTmpRefID = "0", the the whole line will be gone.
How can make it like "ABC" still have 0 showing ? meaning when CountofTmpRefId return null or 0, it still be able to keep all of the list of the agency name?
Thanks
SELECT
COUNT(tblWSBondQuotes.TmpR
SUM(tblWSBondQuotes.BondAm
SUM(tblWSBondQuotes.GrossP
SUM(tblWSBondQuotes.Commis
SUM(tblWSBondQuotes.NetPre
Agency.DBA,
tblWSBondQuotes.sAgencyBro
FROM tblWSBondQuotes INNER JOIN
Agency_Master ON tblWSBondQuotes.sAgencyBro
Agency ON tblWSBondQuotes.sAgencyBro
WHERE (tblWSBondQuotes.StatusID = @StatusID) AND (Agency_Master.StatusId = 1)
GROUP BY tblWSBondQuotes.sAgencyBro
HAVING (Agency_Master.AgencyMaste
3-30-2012-6-49-58-PM.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Both guys's codes do not work...
Both guys's codes do not work...
Unfortuantely this tells me nothing...
When you can spend the time to explain to me in English what you mean by "codes do not work" I will be happy to help. As it is, the feedback is useless.
Unfortuantely this tells me nothing...
When you can spend the time to explain to me in English what you mean by "codes do not work" I will be happy to help. As it is, the feedback is useless.
Open in new window