I want to query my SQL database to display the total count of data in it based on current date and month but my query counts both current and previous date. For instance, if there is 2 entries for 20/08/2018 and 4 entries for 20/07/2018, it returns 6 as total count while I want the query to return only the entries for the current day or month not previous entries.
Here is the query:
var today = db.QueryValue("select count(*) FROM UserName where DAY(signed_in ) = datepart(DAY, getdate());");
var month = db.QueryValue("select count(*) FROM UserName where MONTH(signed_in ) = datepart(month,getdate());");