Solved

Select Where Date Is Yesterday

Posted on 2006-07-21
1
587 Views
Last Modified: 2010-08-05
How do I construct a SQL query where I select all items where a date field is yesterday?
0
Comment
Question by:E-Risk
1 Comment
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 50 total points
ID: 17158723
You can use  " GETDATE() -1 " 

or like this


SELECT * from yourTable
WHERE select Convert (varchar(8),urDateColumn,112)   = select Convert (varchar(8),getdate()-1,112)
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

914 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

14 Experts available now in Live!

Get 1:1 Help Now