shosho s

shosho s

  • NA
  • 137
  • 99.6k

How to get missing records in a month?

Oct 23 2016 8:21 AM
I have a table in which i record the user time in and time out daily in a month.
So lets suppose today a user didnt time in /time out (and there could be many more days in a month.)
 
How can i get these records per month excluding the weekend which is Friday and Saturday? 
 
 
Thank you in advance 

Answers (2)

0
Nitin Sontakke

Nitin Sontakke

  • 131
  • 13.6k
  • 14.9k
Oct 23 2016 12:27 PM
If you are using sql server, all you have to do is, have a table variable with rows with all the required dates in that table.
The select from that table and left outer join (or cross join) with attendance table, you get the all the dates and null next to dates where there is no data.
0
Midhun Tp

Midhun Tp

  • 136
  • 13.2k
  • 1.5m
Oct 23 2016 8:41 AM
Hi,<br><br> Please find the relative solution in sql-<br> http://marlonribunal.com/finding-gaps-in-or-missing-dates-using-tsql/<br><br> Also have a look at below threads for something similar done with linq-<br> http://stackoverflow.com/questions/1468637/filling-in-missing-dates-using-a-linq-group-by-date-query<br> http://stackoverflow.com/questions/35062144/find-missing-date-in-listdatetime-and-insert-that-date-on-the-right-index