Skip to content
Loading
+2
  • +1
    Thank you for your answer, is really amazing to reply back immediately, like i said i dont want to use case fixed date days, i want it in such a way the moment you select jan..... then it gives the whole of january days 1-31 thank you very much
    +1
  • Muhammad Imran Ansari
    +1

    Try the following query for result. For date range you can generate a string for respective date.

    select *
    from
    (
      select attendance, [date]
      from AttendanceRecord
    ) src
    pivot
    (
      COUNT([date])
      for date in ([2020-01-01], [2020-02-01], [2020-03-01], [2020-04-01])
    ) piv

    +1
  • Nitin Sontakke
    +1
    Can you please let me know the reason why you do not want to use CASE expression if it will serve your purpose.
     
    Just curious.
    +1