![]() |
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 |
If the data is stored as a regular datetime field then:
SELECT COUNT(ID) FROM `Members` WHERE Status = 'Active' AND date_format(registration, '%m-%d-%y') ='10-01-05' Should get you all the registrations for October 1. |
Quote:
Good stuff. If I weren't a programmer myself I would hire you for everything. I am not a fucking designer however so I might hit you up still. |
Quote:
|
Thanx :)
|
| All times are GMT -7. The time now is 09:26 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123