Hi All,
I am using SSRS 2008, SQL 2k8 R2 and Report builder 3.0
From my relational database tables, i have created a report model and using that model to build the reports.
in the report model, it looks like if we need to create a very simple report with a SELECT and a WHERE clause, it seems to support fine in the query builder in where you can just drag and drop the model items and also include the filter as a WHERE Clause.
However, i need to build a report whose sql dataset is built on a sub query. to do this, i am not getting any way of how to i get the fields out from sub query.
here is my sql query which i need to translate in the report builder. my report model already has all the fields.
SELECT
TOP (1) Patientsysid, PESysID, PayerSysID, SUM(Amount) AS DueAmt,
(SELECT SUM(Amount) AS Expr1
FROM dbo.ZEB_PatEpisodeTrans
WHERE (RecStatus NOT IN (- 1, - 2, 2)) AND (dtDOE BETWEEN GETDATE() - 30 AND GETDATE()) AND (Patientsysid = PET.Patientsysid) AND
(PESysID = PET.PESysID) AND (PayerSysID = PET.PayerSysID) OR
(RecStatus NOT IN (- 1, - 2, 2)) AND (dtDOE BETWEEN GETDATE() - 30 AND GETDATE()) AND (Patientsysid = PET.Patientsysid) AND
(PESysID = PET.PESysID) AND (PET.PayerSysID IS NULL)) AS currentDue
FROM dbo.ZEB_PatEpisodeTrans AS PET
WHERE (RecStatus NOT IN (- 1, - 2, 2))
GROUP BY Patientsysid, PESysID, PayerSysID
ORDER BY Patientsysid, PESysID, PayerSysID
as mentioned above, here i can select patientsysid, pesysid, payersysid and due amount. when it comes to build the following, i do not know how it works in report builder or report model.
I also tried to add a new field and apply a formula using report model and report builder but it gives me a warning message that it does not return a single value
Any help is much appriciated