... case when m.begintime between ...Second, tell us what the problem is.
>SELECT dbo.corooms.roomname, > case m.begintime > when m.begintime between CONVERT(varchar(15),m.begintime, 110) + > ' 07:00:00' and CONVERT(varchar(15), m.begintime, 110)+' 14:59:00' then 1 > else 0 > end as ShiftType1 > case m.begintime > when m.begintime between CONVERT(varchar(15),m.begintime, 110)+ > ' 15:00:00' and CONVERT(varchar(15), m.begintime, 110)+' 23:59:00' then 1 > else 0 > end as ShiftType2 > >FROM dbo.meetings m INNER JOIN > dbo.corooms ON m.roomid = dbo.corooms.roomid INNER JOIN > dbo.codept ON m.deptid = dbo.codept.deptid >order by roomname >>