I'm getting an error when using a function in a calculated field of my query.
In the query there's a field call [DateWorked], it get's it data from a field in a table that stores short dates. There's a between statement in it's criteria.
The calculated field that generates the error is :
MissedHours: dayMissedHours([DateWorked])
When I call the function in the immediate window of the VB Builder like:
dayMissedHours(#01/11/07#) it works
dayMissedHours(01/11/07) doesn't work, it throws the same error as the query.
This tells me that the problem lies with how the arguments are passed from the query. I don't think [DateWorked] is in date format by the time it get's passed to the function.
MissedHours: dayMissedHours(#[DateWorked]#) doesn't work
MissedHours: dayMissedHours(CDate[DateWorked]) doesn't work
Any other ideas on how I can ensure that [DateWorked] is a date before it's passed to the function would be welcome.