Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8337621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:21:15+00:00 2026-06-09T04:21:15+00:00

I have a SQL Server database with a Date column. These dates are all

  • 0

I have a SQL Server database with a Date column. These dates are all future dates.

How would I go about finding all approaching dates within a 2 week time period? Basically a two week notice query on upcoming dates.

For example: Today is August 2nd. The query would return, if any, dates that were August 16th (2 weeks ahead).

And if it was run tomorrow it would return August 16th and August 17th (2 weeks ahead).

This would obviously be run everyday via a reporting manager (SSRS). Any ideas?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:21:17+00:00Added an answer on June 9, 2026 at 4:21 am

    You can use DATEADD:

    SELECT *
    FROM MyTable
    WHERE MyDateField BETWEEN GETDATE() AND DATEADD(week, 2, GETDATE())
    

    If your column is datetime, you may want to convert it to be a date first, otherwise running this at 12:00 on Aug 1st would return everything upto 12:00 on Aug 15th. The following code will do this for you:

    SELECT *
    FROM MyTable
    WHERE CAST(MyDateField AS date) BETWEEN CAST(GETDATE() AS date) AND CAST(DATEADD(week, 2, GETDATE()) AS date)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my SQL Server database schema I have a data table with a date
in my SQL Server 2005 database I have a column RMA_Number with datatype char(10)
I have a legacy SQL Server 2000 database that has one column that has
I am using SQL Server 2008. I have some dates in my database that
I have a SQL Server CE table with a date column. Any given date
I have got SQL Server database in which Table column name have spaces. For
I have a SQL Server 2008 database with a table that has a column
I have a database in SQL Server 2008 R2 where all tables seem to
I have created SQL Server database by Visual Studio 2010 Ultimate means in Visual
I have a SQL Server Database back-end. I want an internal network front-end UI,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.