Les Isaacs
Registered User.
- Local time
- Today, 13:54
- Joined
- May 6, 2008
- Messages
- 186
Hi All
This works perferctly ...
SELECT DateDiff("d",[Sickness - Start Date],[Sickness - End Date]) AS Expr2
FROM tblCount, [qry Submissionsheets] INNER JOIN staffs ON [qry Submissionsheets].[Employee Name] = staffs.staff_name
WHERE (((IsDate([Sickness - Start Date]))=True) AND ((IsDate([Sickness - End Date]))=True));
... but when I add a criteria of >3 to the field Expr2 I get "Data type mismatch in criteria expression"
How can this be - I have checked that all the [Sickness - Start Date] and [Sickness - End Date] values are valid dates, so surely the DateDiff must return an integer - which it appears to do when I run the query without the criteria on the DateDiff field: so why can't I add a criteria to that DateDiff field:banghead:
Hope someone can help.
Many thanks
Les
This works perferctly ...
SELECT DateDiff("d",[Sickness - Start Date],[Sickness - End Date]) AS Expr2
FROM tblCount, [qry Submissionsheets] INNER JOIN staffs ON [qry Submissionsheets].[Employee Name] = staffs.staff_name
WHERE (((IsDate([Sickness - Start Date]))=True) AND ((IsDate([Sickness - End Date]))=True));
... but when I add a criteria of >3 to the field Expr2 I get "Data type mismatch in criteria expression"

How can this be - I have checked that all the [Sickness - Start Date] and [Sickness - End Date] values are valid dates, so surely the DateDiff must return an integer - which it appears to do when I run the query without the criteria on the DateDiff field: so why can't I add a criteria to that DateDiff field:banghead:
Hope someone can help.
Many thanks
Les