Access DateAdd help (please)

Associate
Joined
27 Nov 2003
Posts
2,486
Location
Loughborough
I have some purchase data which has a due date field and I want to return anything that is due in three months plus, however using >=Month(DateAdd("m",3,Date())) it refuses to pick up anything outside of 2018

What am I doing wrong? I have nothing in the query except Product, Due Date and this calculation. Without the calculation I can see dates in 2019...

This one baffles me, help :)
 
In vb6/access vba I generally find it easier to just convert dates to julian numbers and then just add or subtract whole numbers of days

e.g. >=format(now(), "#")+90


You can also do times in a similar fashion (e.g. the below lists anything half a day from now - 0.5 = 12 hours)
>=format(now(), "#.##########") + 0.5
 
Get rid of the Month(), your internal calculation is already adding 3 months to today, month just converts it to a number (0-11 or 1-12, can't remember which)
 
Back
Top Bottom