How to link two groups of dates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stevestan
    New Member
    • Jul 2010
    • 13

    How to link two groups of dates

    Hi there,
    I just built 2 queries that I linked together with a 3rd querie using an account number. But, I'd like to further expand the criteria of the link. I would like to link the two queries through a date too, but the date doesn't necessarily have to exactly match. I would like a leeway of plus or minus 2 calender days for this link. So if query 1's date is 7/3/2010, I'd like query 2's date to link as long as it's between 7/1/2010 and 7/5/2010. If anyone has a solution for this, I'd greatly appreciate it!
  • patjones
    Recognized Expert Contributor
    • Jun 2007
    • 931

    #2
    I would suggest using the DateAdd function:

    Code:
    WHERE qry2_date BETWEEN DateAdd("d", -3, qry1_date) AND DateAdd("d", 3, qry1_date)

    Pat

    Comment

    Working...