HI I am converting a Crystal Reports, to SSRS using SQL Server 2005. We are using Great Plains and these are reports in SSRS that have/are being converted from Crystal Reports.
Custnmbr is in the table Customerbudget and this is the parameter, but we only have customer name as the parameter, in all of our reports, this is the standard. I need to have a join that will take the Customername from the user and locate the correct number keeping this SQL working correctly as it is. AS I am new to SQL I am not certain how to add in this join to the existing and working SQL:
SELECT Sum("SOP10200"."XTNDPRCE") XTNDPRCE, Sum("SOP10200"."QUANTITY") QUANTITY,
DATEADD(M,DATEDIFF(M,0,SOP10100.DOCDATE),0) ID, "IV40600"."UserCatLongDescr", "IV00101"."ITEMNMBR",
"IV00101"."ITEMDESC",AVG(CustomerBudget.BudgetAmount) as Budget
FROM (((("dbo"."SOP10100" "SOP10100" INNER JOIN "dbo"."SOP10200" "SOP10200"
ON "SOP10100"."SOPNUMBE"="SOP10200"."SOPNUMBE")
INNER JOIN
"dbo"."CustomerBudget" "CustomerBudget" ON "SOP10100"."CUSTNMBR"="CustomerBudget"."CUSTNMBR")
LEFT OUTER JOIN "dbo"."SOP10106" "SOP10106"
ON ("SOP10100"."SOPTYPE"="SOP10106"."SOPTYPE")
AND ("SOP10100"."SOPNUMBE"="SOP10106"."SOPNUMBE"))
INNER JOIN "dbo"."IV00101" "IV00101"
ON "SOP10200"."ITEMNMBR"="IV00101"."ITEMNMBR")
INNER JOIN "dbo"."IV40600" "IV40600"
ON ("IV00101"."ITMGEDSC"="IV40600"."USCATVAL")
AND ("CustomerBudget"."USCATVAL"="IV40600"."USCATVAL")
WHERE "CustomerBudget"."CUSTNMBR"=@CUSTNMBR
AND "SOP10100"."SOPTYPE"=1 and (SOP10100.DOCDATE between @FromDate and @ToDate)
group by DATEADD(M,DATEDIFF(M,0,SOP10100.DOCDATE),0), "IV40600"."UserCatLongDescr", "IV00101"."ITEMNMBR",
"IV00101"."ITEMDESC"
Order by iv40600.UserCatLongDescr, iv00101.ITEMDESC
*This post is locked for comments