Solved

MS SQL query finds all dates that are greater than next Tuesday

Posted on 2014-03-14
1
239 Views
Last Modified: 2014-03-16
Hi There,

How do i go about creating a SQL query for my table that returns all records for a date that is greater than next Tuesday's date?


thanks! Kristin
0
Comment
Question by:forcedexposure
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 500 total points
ID: 39930511
SELECT ...
FROM dbo.tablename
WHERE
    date_or_datetime_column >= DATEADD(DAY, DATEDIFF(DAY, 1, GETDATE()) / 7 * 7 + 7, 1) AND
    date_or_datetime_column < DATEADD(DAY, DATEDIFF(DAY, 1, GETDATE()) / 7 * 7 + 7 + 1, 1)
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question