Solved

previous date

Posted on 2011-02-10
2
224 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
  • 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

839 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