Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

SQL - date range from today until 3 months from now

Hello, Sorry if this isnt the best forum to ask this, but Im digging into a SQL data warehouse, which uses a date field.  The data is populated from 2004 onwards, but I only want to pull the event d...
  • dedelman_clng's avatar
    9 years ago

    From a purely SQL perspective, you want to use

     

    getdate()

     

    to get the current date/time (convert with a mask to eliminate time if necessary)

     

    and

     

    dateadd(month, 3, getdate())

     

    to get the date 3 months from now (use same convert mask if needed).