Solved

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

Posted on 2014-03-14
1
235 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
1 Comment
 
LVL 69

Accepted Solution

by:
ScottPletcher 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now