Why is this not recognised as a valid fieldname or expression... grrrrrr! lol (1 Viewer)

tezread

Registered User.
Local time
Today, 08:22
Joined
Jan 26, 2010
Messages
330
PARAMETERS [Forms]![frmRptDialogSingle]![begdate] DateTime, [Forms]![frmRptDialogSingle]![enddate] DateTime;
TRANSFORM Count(qry_cardiology1.EpisodeID) AS CountOfEpisodeID
SELECT qry_cardiology1.Days
FROM qry_cardiology1
WHERE (((qry_cardiology1.RequestDatetime) Between [Forms]![frmRptDialogSingle]![begdate] And [Forms]![frmRptDialogSingle]![enddate]))
GROUP BY qry_cardiology1.Days
PIVOT qry_cardiology1.ReferringHospital;

this was working fine this query but now it is saying the fieldname Requestdatetime is not recognised by the jet engine!

why?
 

Yarp

Registered User.
Local time
Today, 08:22
Joined
Sep 16, 2009
Messages
51
Try looking up the error code you receive on the error message via a search engine. I usually find a clue that helps me solve my coding mistakes this way. Without knowing your table and form design, it is pretty hard for anyone to diagnose why it isn't working.
 

vbaInet

AWF VIP
Local time
Today, 08:22
Joined
Jan 22, 2010
Messages
26,374
Try wrapping all your field names in square brackets:

qry_cardiology1.[RequestDatetime]
 

SOS

Registered Lunatic
Local time
Today, 00:22
Joined
Aug 27, 2008
Messages
3,517
Crosstabs are picky. Create a query (select only) that uses the parameters to select the data from and then use that query as the basis for your crosstab. You will want to specify the parameters in both even though the crosstab really doesn't have criteria directly on it.
 

Users who are viewing this thread

Top Bottom