Hi Hope all is well, I'm hoping someone can give me an explanation please to what I'm doing wrong here. I've got a query that I was using to calculate the days open on an unclosed entry. I then found a database from pat hartman that excluded weekends https://www.access-programmers.co.uk/forums/threads/sample-date-functions.238821/ so thought id try it in case I ever have to cut out weekends.
I can get the days open ok from the query below
I then assumed i would have to cast the results as double as the initial type was date?
So now I thought the data was in double type, I then tried to average it
...then got a data type mismatch in criteria expression...bit stumped why I can't take an average after casting to a numeric. If anyone can give me a pointer please much appreciated
thanks
I can get the days open ok from the query below
Code:
SELECT tblRma.registered, tblRma.dateremoved, businessdays([registered],[dateremoved]) AS days, tblRma.removed
FROM tblRma
WHERE (((tblRma.removed)=True));
I then assumed i would have to cast the results as double as the initial type was date?
Code:
SELECT CDbl(qryDaysNoWeekend.days) AS Expr1
FROM qryDaysNoWeekend;
So now I thought the data was in double type, I then tried to average it
Code:
SELECT AVG(qryDaysOpen.Expr1)
FROM qryDaysOpen;
...then got a data type mismatch in criteria expression...bit stumped why I can't take an average after casting to a numeric. If anyone can give me a pointer please much appreciated
thanks