Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. select sum(col1), cast(max(col2) as date)
  2. from t;
  3.  
  4. where col2 >= dateadd(hour, -15, cast(getdate() as date)) and
  5. col2 < dateadd(hour, 21, (cast getdate() as date))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement