I am stuck with a problem in MySQL. I want to get the count of records between two date-time entries.
For example:
I have a column in my table named 'created' having the datetime
data type.
I want to count records which were created date-time between "TODAY'S 4:30 AM" and "CURRENT DATE TIME".
I tried some of MySQL's functions but still no luck with it.
Can you please help me with this? thanks.
for speed you can do this
WHERE date(created_at) ='2019-10-21'
select * from yourtable where created < now() and created > '2011-04-25 04:00:00'
select * from yourtable
where created < now()
and created > concat(curdate(),' 4:30:00 AM')
Source: Stackoverflow.com