I am using a SQL Server database, and I need to get the total number of newly inserted records per day, per week, per month, and per year separately. I have a column in my SQL Server database that records the date and time (the data type is datetime
).
I used the following code to get the daily records but doesn't work
SQL:
select count(*)
from dbo.Firsttimer
where (Signed_in) = date(date_sub(now());
Please how do I achieve this?