Hi everyone, I've been really stuck on this so I hope someone can help me out.
I have an access 2007 database and am trying to do a calculation on the dates.
I am taking the average over 5 years, so from my transactions table I take the date field and I drop the year and group (to get the average for 01/01). I then want to add in the current year, so I take those first 5 characters and add the current year:
forecast_date: DateValue(Left([Value_Date],Len([Value_Date])-5) & "/" & Year(Date()))
The problem is I want the query to return only dates that are greater than today and less than today + 35. I tried using DateDiff:
datedifftest: DateDiff("d",[forecast_date],Date()) and it returns a number but I am not able to put a criteria on it. I even tried creating a sub query where my criteria was >0 and <35 but I get "Data type mismatch in criteria expression.
Any feedback is much appreciated.
I have an access 2007 database and am trying to do a calculation on the dates.
I am taking the average over 5 years, so from my transactions table I take the date field and I drop the year and group (to get the average for 01/01). I then want to add in the current year, so I take those first 5 characters and add the current year:
forecast_date: DateValue(Left([Value_Date],Len([Value_Date])-5) & "/" & Year(Date()))
The problem is I want the query to return only dates that are greater than today and less than today + 35. I tried using DateDiff:
datedifftest: DateDiff("d",[forecast_date],Date()) and it returns a number but I am not able to put a criteria on it. I even tried creating a sub query where my criteria was >0 and <35 but I get "Data type mismatch in criteria expression.
Any feedback is much appreciated.