Solved

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

Posted on 2014-03-14
1
240 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

688 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