Question : How to Query a timestamped field (smalldatetime) for yesterdays date in a where clause?

Which function is best for querying yesterday's date from a timestamped field (smalldatetime)?

For example:

select *
from securitymoneyactivity
where uploaddate = Datepart? DateDiff? or DateADD? etc....
---UploadDate being the timestamped field

I need a "GetDate() -1" return on my results.

Answer : How to Query a timestamped field (smalldatetime) for yesterdays date in a where clause?

select * from securritymoenyactivity where datediff(day,uploaddate,getdate())=1
http://msdn.microsoft.com/en-us/library/ms189794.aspx
Random Solutions  
 
programming4us programming4us