Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

SQL select past number of days

select count(Id) as 'Logins for Past 7 Days'
from dbo.Users 
where LastLoggedIn between dateadd(day, -7, convert(date, getdate())) 
and dateadd(day, -0, convert(date, getdate()))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #SQL #select #number #days
ADD COMMENT
Topic
Name
7+3 =