Selecting number of Yesterday registration (Unix Timestamps)

Selecting number of Yesterday registration (Unix Timestamps)
0

#1

I use UnixTimestamp to store date of registration.
Now,I want to select number of registration:today,yesterday,etc.For statistic

I’m succesful SELECT number of today registration:

SELECT COUNT(ID) AS brreg FROMusersWHERE date > UNIX_TIMESTAMP(CURDATE())

Now,I need help with SELECT number of just yesterday registration.

I’m try with this:

SELECT COUNT(ID) AS brreg FROMusersWHERE date > UNIX_TIMESTAMP(DATE_ADD(CURDATE(),INTERVAL -1 DAY))

But this will give me count from yesterday + today.


#2

I’m solve this…

SELECT COUNT(ID) AS brreg FROMusersWHERE date > UNIX_TIMESTAMP(DATE_ADD(CURDATE(),INTERVAL -1 DAY)) AND date < UNIX_TIMESTAMP(CURDATE())