getting the right query info

J

JohnE

I am doing a report of all the revenue for active
clients. But within the same tables there is demo
information. I am able to eliminate the demo information
from the reports so far with the exception of the revenue
report. I have the following query for the report, but,
the demo info still appears.

SELECT usrtblClientInformation.ClientName,
usrtblClientInformation.OverallClientStatus,
usrtblEstimatedRevenue.EstimatedRevenueItem, Sum
(usrtblEstimatedRevenue.EstimatedRevenueAmount) AS
SumOfEstimatedRevenueAmount
FROM usrtblClientInformation INNER JOIN
usrtblEstimatedRevenue ON
usrtblClientInformation.ClientCode =
usrtblEstimatedRevenue.ClientCode
GROUP BY usrtblClientInformation.ClientName,
usrtblClientInformation.OverallClientStatus,
usrtblEstimatedRevenue.EstimatedRevenueItem
HAVING (((usrtblClientInformation.ClientName)=[Forms]!
[usrfrmReportModule]![cbxClientName]) AND
((usrtblClientInformation.OverallClientStatus)<>"Demo"))
OR ((([Forms]![usrfrmReportModule]![cbxClientName]) Is
Null)) OR (((usrtblClientInformation.OverallClientStatus)
<>"Demo"));

Thanks to anyone for any assistance.
*** John
 
S

Steve Schapel

John,

I think the HAVING clause should be more like this...

HAVING
((((usrtblClientInformation.ClientName)=[Forms]![usrfrmReportModule]![cbxClientName])
OR ([Forms]![usrfrmReportModule]![cbxClientName] Is Null)) AND
((usrtblClientInformation.OverallClientStatus)<>"Demo"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top