Link to home
Start Free TrialLog in
Avatar of Chris Miller
Chris MillerFlag for United States of America

asked on

Access 2007 Date Query Criteria -6

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 - 01/01/2015

the query would pull only the dates starting 01/01/2009 to 01/01/2015
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

select [datefield]
from tablex
where  [datefield] Between Dateadd("yyyy",-6,[Enter Date]) And [Enter Date]
Avatar of Chris Miller

ASKER

Sorry, I just realized that I posted the query wrong.

ex: user input - 01/01/2015

 the query would pull only the dates that are in the 6th year, which would be all of 2009
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial