I currently have a query that calculates the time difference between a notifed date/time and arrival date/time along with a number of additional pieces of information incuding type of structure. I have date and time as separate fields in the main table, so first have to combine them and then subtract the combined fields to come up with a response time. Here is the code:
From this query, I do another query that selects a particular type of structure. That works fine. Here is that code.
I then create a third query that selects some of the columns. Here is that code:
My problem is when I try to put in a criteria for the response time of >120, I get the error message "Data Type mismatch in criteria expression". No matter what I do I can't seem to fix it. I've added [Response] as a parameter for Integer, but that didn't work, so I took that out. If I take out >120 as a criteria under Response I get the full list, so know my problem has something to do with the >120 but I don't know where else to look.
Thanks
Code:
PARAMETERS [forms].[frm date selection].[start date] DateTime, [forms].[frm date selection].[end date] DateTime;
SELECT tblIncidents.[Incident Number], tblIncidents.[Run Number], tblIncidents.Structure, tblIncidents.[Notified Date], tblIncidents.[Notified Time], tblIncidents.[Arrival Date], tblIncidents.[Arrival Time], [Notified Date] & " " & [Notified Time] AS Notified, [Arrival Date] & " " & [Arrival Time] AS Arrival, (DateDiff("N",[Notified],[Arrival])) AS Response
FROM tblIncidents
WHERE (((tblIncidents.[Run Number])=1) AND ((tblIncidents.[Notified Date]) Between ([forms].[frm date selection].[start date]) And ([forms].[frm date selection].[end date])));
Code:
SELECT [q Response Time report - detail].[Incident Number], [q Response Time report - detail].Structure, [q Response Time report - detail].[Notified Date], [q Response Time report - detail].Response FROM [q Response Time report - detail] WHERE ((([q Response Time report - detail].Structure)="sfd"));
Code:
SELECT [q Response Time report - detail].[Incident Number], [q Response Time report - detail].Structure, [q Response Time report - detail].[Notified Date], [q Response Time report - detail].Response FROM [q Response Time report - detail] WHERE ((([q Response Time report - detail].Structure)="sfd") AND (([q Response Time report - detail].Response)>120));
Thanks
Comment