0

I have a database (MyISAM) that stores user inputed entries for each day. It's basically a worksheet for employees where they enter what they did on a particular day.

I need to get the days in which users did not enter any entries so i can mark that day as a vacation day. More exactly, i need to get a table like

    Date           User 
    20-11-2013     test1
    20-12-2013     test1
    20-12-2013     test2

How exactly do i go about doing this?

  • do you have an entries column? – Sam Dec 09 '13 at 21:53
  • yes, there is a column for entry start time and one for entry end time – user3084616 Dec 09 '13 at 21:54
  • build another table with all the dates in it for comparison, or use ddd date formats an select the nbumbers < 365 to do the comparison – Randy Dec 09 '13 at 21:54
  • Choices: 1. sproc, 2. UNION, 3. calendar table, 4. application level code – Sam Dec 09 '13 at 21:55
  • either calendar table or aplication level code considering i'm outputting the data in php – user3084616 Dec 09 '13 at 21:57
  • This may help: http://stackoverflow.com/questions/2157282/generate-days-from-date-range. Haven't got a full solution (yet), but I'm thinking `LEFT JOIN` this to your entries table, or join with a `COUNT` on the entries table with a group by on Date and User, and you can easily pick out those dates with no matching records. – CompuChip Dec 09 '13 at 22:25

0 Answers0