How to find total number of records assigned to user on a particular day. Please help me to resolve this.
Announcement
Collapse
No announcement yet.
How to find total number of records assigned to user on a particular day
Collapse
X
-
If it is a day in the past the only place you could get this information from is the table note,but only if all your entities have a stream.
Code:SELECT DATE_FORMAT(created_at,'%d.%m.%Y') as Date, COUNT(id) as RecordsAsigned FROM `note` WHERE `data` like '%"assignedUserName":"Bob User"%' GROUP BY DATE_FORMAT(created_at,'%d.%m.%Y')
Last edited by Andorxor; 05-09-2019, 08:23 AM.
-
This Sqlstring should be a bit better than the first one which needed a username.
Code:SELECT CONCAT(`user`.first_name," ",`user`.last_name) as username, DATE_FORMAT(`note`.created_at,'%d.%m.%Y') as Date, COUNT(`note`.id) as RecordsAssined FROM `note` INNER JOIN `user` ON `note`.`data` LIKE CONCAT('%"assignedUserId":"',`user`.`id`,'"%') GROUP BY CONCAT(`user`.first_name," ",`user`.last_name),DATE_FORMAT(`note`.created_at,'%d.%m.%Y')
Last edited by Andorxor; 05-09-2019, 08:22 AM.
Comment
Comment