
/****** Object:  StoredProcedure [dbo].[Calc_Habit_Ocup_Hotel_NoOut]    Script Date: 11/27/2014 15:57:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO






DROP  PROCEDURE [dbo].[Calc_Habit_Bloqueadas_Hotel_Presente] 
GO

CREATE  PROCEDURE [dbo].[Calc_Habit_Bloqueadas_Hotel_Presente] @dia datetime,@total int output
AS
begin
  Select @total = Count(id_ford) 
  From       HOTEFORD 
  Where  (CAST(@dia AS DATE) BETWEEN CAST(fecha_desde AS DATE)
    AND  CAST(fecha_hasta AS DATE))

  if @total is null
    Select @total = 0
end























