Solved

previous date

Posted on 2011-02-10
2
226 Views
Last Modified: 2012-05-11

I want to get only previoudate from mytable1. Orderdate is datetime
select orderdate, amount_ordered from mytabl1 where orderdate is the previousdate
0
Comment
Question by:VBdotnet2005
[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
  • 2
2 Comments
 
LVL 23

Accepted Solution

by:
wdosanjos earned 125 total points
ID: 34867034
It should be something like:

select orderdate, amount_ordered
from mytabl1
where orderdate < CAST(getdate() as DATE)
0
 
LVL 23

Expert Comment

by:wdosanjos
ID: 34867050
Or:

select orderdate, amount_ordered
from mytabl1
where CAST(orderdate as DATE) = DATEADD(day,-1,CAST(getdate() as DATE))
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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 set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

617 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