CREATE PROCEDURE dbo.GetDayColorForPeriod @AStartDateTime DATETIME, @AEndDateTime DATETIME, @AHotelNumber INT = -1  AS
-- Created AV 2007 1115 used in online booking

SELECT 
  CASE DayColor  WHEN 32768  THEN  1 
  WHEN 65535 THEN  2
  WHEN 255 THEN 3
  WHEN 16711680 THEN 4
  ELSE 0
END AS DayColor, DateStamp
  FROM RoomBookingStatusYield WITH (NOLOCK)
WHERE DateStamp BETWEEN  @AStartDateTime  AND  @AEndDateTime AND (@AHotelNumber = -1 OR HotelNumber = @AHotelNumber)


