sql server 2008 - SQL-select previous day and exclude today -


i need include records registered yesterday exclude records has been registered today. not sure if query giving me correct numer of records. please help

select id, lastmodifieddate  stu_tbl last_modified_date > dateadd(d, - 1, getdate()))  , _last_modified_date <>  getdate()) 

try this:

select id, last_modifieddate  stu_tbl last_modified_date >= dateadd(d, -1, cast(getdate() date))    , last_modified_date < cast(getdate() date)  

Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -