Chris Miller
asked on
Access 2007 Date Query Criteria -6 by date
I need help with a query on one of my tables. On one of the table fields there is a date mm/dd/yyyy. I need to have the user input a future date and then count back 6 years from the table field date. I only want to see the dates that fall in the 6 year window.
ex: user input - 06/01/2015
the query would pull only the dates starting 06/01/2009 to 05/31/2010
ex: user input - 06/01/2015
the query would pull only the dates starting 06/01/2009 to 05/31/2010
ASKER
Thats not working
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am getting a "The expression you entered has an invalid string" A string can be up to 2048 char long, including opening and closing quotation marks
ASKER
found it
("yyyy'
("yyyy'
ASKER
is my thinking correct on this?
If I am going back 6 yrs from a date ( 06/15/2015 ) would that be in between 6/01/2009 to 5/31/2010?
or is it between 5/31/2008 to 6/01/2009?
If I am going back 6 yrs from a date ( 06/15/2015 ) would that be in between 6/01/2009 to 5/31/2010?
or is it between 5/31/2008 to 6/01/2009?
Not sure - open the immediate window of VBA and type in the expression as ?Datevalue(with your details) and see what it returns.
Kelvin
Kelvin
WHERE DATE BETWEEN DATEADD("yyyy",-6, Date Passed) and DatePassed