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 7955255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:40:25+00:00 2026-06-04T03:40:25+00:00

I have a table that has a TASK_START_DATE and TASK_FINISH_DATE Columns of type datetime

  • 0

I have a table that has a TASK_START_DATE and TASK_FINISH_DATE Columns of type datetime

I need help with a query that returns all Tasks when the Task: (date = just the date – I think I can do a conversion to the date from datetime on SQL 2008R2, it works fine)

– is within 2 weeks previous of the current date or two weeks after the current date.

Similarly I also need the records whose TaskEnd values are within 2 weeks previous or two weeks before

I’ve been trying things like which would get tasks where the start date is within the two previous weeks, but I have to do the same for TASK_FINISH_DATE and I think my and’s and or’s are all jumbled up, any help is appreciated.

Convert(Date, TASK_START_DATE) <=  Convert(Date, DateAdd(ww, -2, GetDate())) 

Short version:
How do I correctly write a query that combines all records with the TASK_START_DATE OR TASK_END_DATE within two weeks in the future or past, i.e.

Select Task_ID, TASK_NAME, TASK_START_DATE, TASK_END_DATE
where 
???
  • 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-04T03:40:26+00:00Added an answer on June 4, 2026 at 3:40 am

    You can add days to your date for comparision:

    Select * from Table
    Where column between getdate()-14 and getdate()+14
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that has three different date columns, so I set each
I have a table that has two columns: CommunityID PersonID And A People table
I have periods table that has start_at:datetime end_at:datetime . Because each period begins and
i have a table that has following column Type -------- type 1 type 2
my sql server table named timesheet has 4 columns employee_id int task_start_date datetime task_end_date
I have a table that has an AUTO_INCREMENT field. Currently, it is also a
I have one table that has sales records and another table that has additional
I have a table that has records with a structure similar to this.. ID
i have a table that has event name and event date. if i want
I have a table that has a certain numeric column called Score . I

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.