adhoustonj
Member
- Local time
- Yesterday, 19:11
- Joined
- Sep 23, 2022
- Messages
- 157
I have 2 subforms that both have a date between query, but one of them throws the "expression is typed incorrectly, or it is too complex to be evaluated" error. If i remove the where clause, then the query runs fine. I've tried adding the parameters statement as I see that solves it for some people, but it is not working for me. Any clues on what is causing this error?
SQL:
PARAMETERS [Forms]![frmReports]![bdate] DateTime, [Forms]![frmReports]![edate] DateTime;
SELECT tblProduction.prd_id, tblProduction.stat_id, tblWI.wi, tblDowntime.dt_str, tblDowntime_reasons.reason,
tblDowntime.dt_stp, DateValue([dt_str]) AS pdate, DateDiff("n",[dt_str],[dt_stp]) AS dt
FROM tblWI INNER JOIN (tblProduction INNER JOIN (tblDowntime_reasons INNER JOIN tblDowntime ON tblDowntime_reasons.dtr_id = tblDowntime.dtr_id)
ON tblProduction.prd_id = tblDowntime.prd_id) ON tblWI.wi_id = tblProduction.wi_id
WHERE (((DateValue([dt_str])) Between [Forms]![frmReports]![bdate] And [Forms]![frmReports]![edate]))
ORDER BY tblProduction.prd_id, tblProduction.prd_str;