DECLARE @Now DATETIME = GETDATE(); DECLARE @7DaysAgo DATETIME = DATEADD(day,-7,@Now); SELECT * FROM emp WHERE date BETWEEN @7DaysAgo AND @Now ORDER BY date
select *from tbl_payment where paid_date between dateadd(DAY,-7,GETDATE()) and getdate()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)