1

I'm not sure if it's possible in MySQL. I want to show "Log" table belowenter image description here

Like this format enter image description here

Unlike the first table, all the date are shown on the second table including holidays and weekday. I've tried to search in Google but i don't know the term of what i'm trying to do. Thank you!

Seehyung Lee
  • 590
  • 1
  • 15
  • 32
  • Have you got any initial SQL? I'm having a hard time to understand what exactly you need. – acdcjunior Apr 16 '13 at 23:18
  • 1
    If you want want output rows, even for dates which don't exist in your data, the common way is to create a calendar table and join on that. See this question and answers. http://stackoverflow.com/q/75752/302243 – Austin Phillips Apr 16 '13 at 23:22

1 Answers1

0

Something like this:

SELECT DAYNAME(TIME_ENTER),DATE(TIME_ENTER),DEPT_NAME AS DEPARTMENT,NAME,TIME(TIME_ENTER) AS TIME_IN,TIME(TIME_EXIT) AS TIME_OUT FROM Log;

You would need a second table for holidays to cross compare for highlighting as Holidays are different in different countries.

AbsoluteƵERØ
  • 7,816
  • 2
  • 24
  • 35