Greater than 6 months query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gavyn613
    New Member
    • May 2006
    • 2

    Greater than 6 months query

    Hello,
    I am trying to query for dates that are greater than 6 months from today's date.

    This query would also need to be re-usable at a later date.

    Can anyone help me please?
  • Gavyn613
    New Member
    • May 2006
    • 2

    #2
    Ok, I did more research, and this is what I did

    Expr1: DateDiff("m",[DateField],#Today's Date#)

    Then filtered the criteria with >=6

    If anyone knows of a better method, I am all ears, but I wanted to share what worked for me.

    Thank you

    Comment

    • CaptainD
      New Member
      • Mar 2006
      • 135

      #3
      You might find
      Code:
      [DateField] > DateAdd("m", 6, date())
      more accurate

      Comment

      • eralper
        New Member
        • May 2006
        • 5

        #4
        Hi,

        I think all are the same but I wanted to add the below sample

        SELECT COUNT(*) FROM Sales WHERE DATEDIFF(m , InsertDate , GETDATE()) > 6

        Comment

        • CaptainD
          New Member
          • Mar 2006
          • 135

          #5
          I assumed you wanted 6 months in the future from now which is what I gave you, Eralper's method will give you, both directions and will round to the month.

          Comment

          Working...