• pietlinden (10/23/2016)


    You may need to tweak the WHERE clause so it returns exactly what you want.

    Your answer is perfect if you need to filter for the past 24 hours. As for the original post it looks like the result must match today and yesterday (whole day), so you'll need to filter only on the DATE part. That would lead to altering the WHERE clause to:

    ...

    WHERE x.evntTime > cast(GETDATE()-1 as date)

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **