Wednesday, August 8, 2012

filter on current date and passing time

Table meeting has start and end time field and to select all meetings for today and exclude meetings finished two hours ago.

select * from meeting
where convert(date, start) = convert(date, getdate())
and cast(start-getdate() as float)*24*60 < -120