I am having a table structure like this
id int
checkinttime datetime
checkouttime datetime
roomid int
I have recorded checkin and checkout time in this table. My question is how to generate a datewise report that generate whether room occupied or not in that date range like this.
room 3/1/2016 3/2/2016 3/3/2016 6/4/2016
r1 P V V P
r2 v p p p
where p means Occupied, and V means vacant. How to write SQL for this.?
Thanks in advance.