SQL Server - error stored procedure

 
Vista:

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
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:error stored procedure

Publicado por sergio (21 intervenciones) el 02/03/2009 17:07:14
te falta el comando group by ya que si queres tortalisar tenes que poner este comando por todos los campos qu etenes ebn el select
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:error stored procedure

Publicado por Mau (67 intervenciones) el 03/03/2009 00:22:57
Que paso Bing? No funcionó con .NET?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar