The GetOnlineUserStatistics storedprocedure is used to get the number of users registered today and yesterday. However, this SP uses the time as well as the date to determine the count. This actually results in a count of the users in the last twenty-four hours and the previous twenty-four hours. To get an accurate count of the new registered users for today and yesterday, the following SELECT statements should be replaced with the last two SELECT statements.
-- Members in last day
select count(*)
from UserPortals
where PortalId = @PortalID and CreatedDate > DateAdd(d, -1, GetDate())
-- Members day before
select count(*)
from UserPortals
where PortalId = @PortalID and CreatedDate > DateAdd(d, -2, GetDate())
and CreatedDate < DateAdd(d, -1, GetDate())
-- Members in last day
-- Changed on 08/08/08 by R. White for TX-HHSC-OIG
select count(*)
from UserPortals
where PortalId = @PortalID
and convert(nvarchar(10),CreatedDate,101) = convert(nvarchar(10),GetDate(),101)
-- Members day before
-- Changed on 08/08/08 by R. White for TX-HHSC-OIG
select count(*)
from UserPortals
where PortalId = 0
and convert(nvarchar(10),CreatedDate,101) = convert(nvarchar(10),DateAdd(d, -1, GetDate()),101)