DSum Problem

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I have a Query. I'm trying to run a DSum() from it and I keep getting an
error. What is the correct Syntax here?

SELECT tblCheckDetails.CDItemID, Sum(tblCheckDetails.CDQuantity) AS
SumOfCDQuantity, tblItems.ItemName, tblCheckDetails.CDPrice,
Sum([CDQuantity]*[CDPrice]) AS EXT, tblCheckDetails.CDReportID,
tblReportCats.ReportCatName
FROM ((QueryDates INNER JOIN tblCheckDetails ON QueryDates.CDBizDay =
tblCheckDetails.CDBizDay) INNER JOIN tblItems ON tblCheckDetails.CDItemID =
tblItems.ItemID) INNER JOIN tblReportCats ON tblCheckDetails.CDReportID =
tblReportCats.ReportCatID
GROUP BY tblCheckDetails.CDItemID, tblItems.ItemName,
tblCheckDetails.CDPrice, tblCheckDetails.CDReportID,
tblReportCats.ReportCatName;

DSum("EXT","Query2",CDReportID = " & Report!rptQty!CDReportID)

Thanks
DS
 
What's the data type of CDReportID? If it's text, you need quotes around the
value you're passing:

DSum("EXT","Query2",CDReportID = '" & Report!rptQty!CDReportID & "'")

Exagerated for clarity, that's

DSum("EXT","Query2",CDReportID = ' " & Report!rptQty!CDReportID & " ' ")

If that's not the issue, what's the error you're getting?
 
Thanks Douglas,
So it seems that it wasn't a coding issue but a timing isuue with the
frmReportDates form. Problem solved.
Thank you.
DS
 
Back
Top