Hi Guys,
As per the title - I have a crosstab query with a date field (Collection Date) where i've got a parameter [Enter Date] to force the user to specify an individual date which will filter the crosstab query. This works perfectly (yay Access) however, when I try to run a report that uses said crosstab query as its data source, I get prompted a few times for a parameter then i'm left with the very annoying "Microsoft database engine does not recognize " as a valid field or expression" message.
The SQL for my crosstab is:
Code:
PARAMETERS [Enter Date] DateTime;
TRANSFORM Sum(qryProductsPerDay.Expr1) AS SumOfExpr1
SELECT qryProductsPerDay.[Collection Date], qryProductsPerDay.Product_Name, qryProductsPerDay.Quantity, qryProductsPerDay.UOM, Count(qryProductsPerDay.Expr1) AS [Total Of Expr1]
FROM qryProductsPerDay
WHERE (((qryProductsPerDay.[Collection Date])=[Enter Date]))
GROUP BY qryProductsPerDay.[Collection Date], qryProductsPerDay.Product_Name, qryProductsPerDay.Quantity, qryProductsPerDay.UOM
PIVOT qryProductsPerDay.[Platter Name];
As I say, this works perfectly when running the query on its own. The "Collection Date" text box on my report has the following text in it (created by the report wizard, not me) "=Format$([Collection Date],"Long Date",0,0)" Is this where my issue lies?
As ever - thanks very much for looking into this for me!
Jon