I have the following query to sum customer orders by week. When I run this query, I get "Sytax error or access violation". If I replace the question marks with getdate(), it returns data as expected, hoever, I need to be able to use a parameter that will point to cell B2 in Excel. Usually just putting a question marks works for this, but maybe not in a case statement? I'd also like the column name to be the value of the cell the parameter points to. Thanks in advance for the help.SELECT FSE_Item.ItemNumber, FSE_Item.ItemDescription, Week1 = SUM(CASE WHEN FSE_POLine.RequiredDate BETWEEN ?-7 AND ? THEN FSE_POLine.LineItemOrderedQuantity ELSE '0' END)FROM BIReports.dbo.FSE_Item FSE_Item, BIReports.dbo.FSE_POHeader FSE_POHeader, BIReports.dbo.FSE_POLine FSE_POLineWHERE FSE_POLine.POHeaderKey = FSE_POHeader.POHeaderKey AND FSE_POLine.ItemKey = FSE_Item.ItemKey AND ((FSE_POHeader.VendorID='v10259'))GROUP BY FSE_Item.ItemNumber, FSE_Item.ItemDescriptionORDER BY FSE_Item.ItemDescription