For previous day I used use the below expression .
DATE_INSERTED >=DATEADD(day, DATEDIFF(day,0,GETDATE())-1,0)
AND DATE_INSERTED < DATEADD(day, DATEDIFF(day,0,GETDATE()),0)
How to get rows from yesterday 10Am to today 10AM
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…