MySQL Forums
Forum List  »  Newbie

MYSQL monthly record view
Posted by: mafaz haniffa
Date: June 19, 2023 11:06PM

MySQL help, I have Attandance Table, how to show missing records as absent between Jan 1st to Jan 31st. for example there is records for Jan 1st, 2nd and 3rd but no records added for 4th, 5th coz absent, how to get those two days as absent missing days in mysql.

I tried creating temporary table as mycalendar adding values for 1 month days.
then tried to left join using below code. but still i'm unable

SELECT * FROM `attTable`
LEFT JOIN mycalendar ON date(attTable.TimeIN) = date(mycalendar.myday)
WHERE attTable.EMPID ='100003'
ORDER BY attTable.EMPID;

Options: ReplyQuote


Subject
Written By
Posted
MYSQL monthly record view
June 19, 2023 11:06PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.