previous date


I want to get only previoudate from mytable1. Orderdate is datetime
select orderdate, amount_ordered from mytabl1 where orderdate is the previousdate
VBdotnet2005Asked:
Who is Participating?
 
wdosanjosConnect With a Mentor Commented:
It should be something like:

select orderdate, amount_ordered
from mytabl1
where orderdate < CAST(getdate() as DATE)
0
 
wdosanjosCommented:
Or:

select orderdate, amount_ordered
from mytabl1
where CAST(orderdate as DATE) = DATEADD(day,-1,CAST(getdate() as DATE))
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.