|
SQL question
Guys, I need some help here.
I am trying to find out today's singups. But, seems to me below statements give me last 24hour. I just wanna know how to get correct result for the current day.
Today's Signups:
SELECT COUNT(ID) FROM `Members` WHERE Status = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(registration)) <= 1;
SELECT COUNT(ID) FROM `Members` WHERE Status = 'Active' AND DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= registration;
is this also correct way to find out logins for the current day, not last 24 hours?
Last 1 day's login
SELECT COUNT(ID) FROM `Members` WHERE Status = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(lastlogin)) <= 1;
Big thanks
Daddy
|