I have a query that pulls data from a number of tables.
My manager has asked that I add a field, using data from a function he created (copied?) years ago, which calculates the number of work days between two dates and returns this as a LONG number.
I should add that this function is used elsewhere in the database and has worked as expected for years, with no problems.
When I add it to a SELECT query, it returns a number and these numbers are correct.
However, if I add a criteria to the field that uses this query (e.g. <=14) I get a message 'Data type mismatch in criteria expression'.
I've narrowed it down to the point where I know it's definitely this field that's causing the problem.
Does anyone know of any limits/weaknesses within Access if using a function in combination with criteria in this way?
My manager has asked that I add a field, using data from a function he created (copied?) years ago, which calculates the number of work days between two dates and returns this as a LONG number.
I should add that this function is used elsewhere in the database and has worked as expected for years, with no problems.
When I add it to a SELECT query, it returns a number and these numbers are correct.
However, if I add a criteria to the field that uses this query (e.g. <=14) I get a message 'Data type mismatch in criteria expression'.
I've narrowed it down to the point where I know it's definitely this field that's causing the problem.
Does anyone know of any limits/weaknesses within Access if using a function in combination with criteria in this way?