I am having a problem using a form to supply dates to a crosstab query. I have a form named "frmGetDates_ESS" and it has two text fields "dfrom" and "dto". Here is the SQL view of my query.
All I get is an error message:
"The Microsoft Jet database engine does not recognize '[forms]!frmGetDates_ESS]![dfrom.[Caption]' as a valid field name or expression"
Please help if you can. I am not sure if I can use a form to supply dates to a crosstab query. Thanks
Matthew
Code:
PARAMETERS [from] DateTime, [to] DateTime;
TRANSFORM Count(dbo_CallLog.ID) AS CountOfID
SELECT [AnsweredByFirstName] & " " & [answeredbylastname] AS Name
FROM dbo_CallLog
WHERE (((dbo_CallLog.StartTime) Between [forms]![frmGetDates_ESS]![dfrom] And [forms]![frmGetDates_ESS]![dto]) AND ((dbo_CallLog.Direction)=0) AND ((dbo_CallLog.Result)<3) AND ((dbo_CallLog.ToID)=3194 Or (dbo_CallLog.ToID)=5182) AND ((DateDiff("s",[starttime],[stoptime]))>0))
GROUP BY [AnsweredByFirstName] & " " & [answeredbylastname]
PIVOT Format([StartTime],"hh");
All I get is an error message:
"The Microsoft Jet database engine does not recognize '[forms]!frmGetDates_ESS]![dfrom.[Caption]' as a valid field name or expression"
Please help if you can. I am not sure if I can use a form to supply dates to a crosstab query. Thanks
Matthew