I am trying to create a report to generate W2 records for multiple employees. I have 5 datasets in the report. One that generates the gross wages for the employees, and one each to generate the Medicare, Social Security, Fed, and State taxes. The query (I am using in the data source (W2) is:Select EmployeeName, SSN, sum(Grossamount) as "Gross Wages"From CheckRegister CR inner join Payee P on CR.PayeeID = P.PayeeID Where YEAR(checkdate) = @W2Year Group By cr.payeeid, EmployeeName, SSNFor the field on the W2 form, I have created the expression: =Sum(Fields!Gross_Wages.Value, "W2")The expression for displaying the SSN is: =Left(First(Fields!SSN.Value, "W2"), 3) + "-" + Mid(First(Fields!SSN.Value, "W2"), 4,2) + "-" + Right(First(Fields!SSN.Value, "W2"), 4)When I have tested the query in Sql Server, it returns all of the employees and sums the gross wages by employee. However, in SSRS, it is summing up all the gross wages for all of the employees. The report only displays the first SSN it finds, but sums all the wages and assigns it to this first SSN.Not sure what I am doing wrong here. Any help appreciated !
↧