I have a query which I got help with but I am stuck on another bit.
The code I have is
SELECT a.name, COUNT(*) AS num FROM table2 b
INNER JOIN table1 a
ON b.status_id=a.id
GROUP BY status_id
What I would like to do now is only show the results if they have been entered on the current date? The date column is in table2. The format for the date column is date and time (eg 1341241153) which is automatically set by the CRM in this way. I am not sure what format this is in!
I only need to check if the date matches the current day. I hope that is clear.
This is a MySQL database.
Any help will be gratefully received!
You should use
from_unixtime()function on date column that holds values like1341241153.Because these values seem stored in unix timestamp format.
Example:
Your query should be: