error stored procedure
Publicado por bingsiu (23 intervenciones) el 01/03/2009 22:45:03
Este s.p. me da un error invalid column totday, si me pudieran aclarar algo. gracias.
ALTER PROCEDURE [dbo].[SelectCustomtr]
-- Add the parameters for the stored procedure here
@StartDate Varchar(8),
@EndDate Varchar(8),
@tot int output
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT
totday,datein,[12], [3], [18], [11], [16], [15]
FROM(select count(totday) as tot,resv,room,datein from Table1 where (datein >= @StartDate and datein<= @EndDate)) AS T1
PIVOT (max(resv) FOR room IN ([12], [3], [18], [11], [16], [15])) as test
END
ALTER PROCEDURE [dbo].[SelectCustomtr]
-- Add the parameters for the stored procedure here
@StartDate Varchar(8),
@EndDate Varchar(8),
@tot int output
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT
totday,datein,[12], [3], [18], [11], [16], [15]
FROM(select count(totday) as tot,resv,room,datein from Table1 where (datein >= @StartDate and datein<= @EndDate)) AS T1
PIVOT (max(resv) FOR room IN ([12], [3], [18], [11], [16], [15])) as test
END
Valora esta pregunta


0