2016-08-19 7 views
-2

を宣言する必要がありますし、私は、ストアドプロシージャは私がレポートを生成する必要がスカラー変数「@fecha」

ALTER procedure [dbo].[reproted] 

@fecha date = null 

as 
begin 

select tbldatostempcaptura2.iddatostempcaptura,tbldatostempcaptura2.primernombre, tbldatostempcaptura2.segundonombre, 
tbldatostempcaptura2.primerapellido, tbldatostempcaptura2.segundoapellido, tbldatostempcaptura2.comentario, 
tbldatostempcaptura2.fecharegistro, tbdatosgeneralesciudadano.fechanacimiento, tbdatosgeneralesciudadano.telefono, tbusuarios.idusuario 
from tbldatostempcaptura2 inner join tbdatosgeneralesciudadano on tbldatostempcaptura2.iddatostempcaptura=tbdatosgeneralesciudadano.iddatostempcaptura 
inner join tbusuarios on tbldatostempcaptura2.idusuario=tbusuarios.idusuario where [email protected] 
end 

@fechaを宣言する方法上の任意の提案をでこれを持っていますか?

+0

Google *可変変数SQLサーバー* –

答えて

0
--drop proc [reproted] 
CREATE PROCEDURE [dbo].[reproted](@fecha SMALLDATETIME) 
AS 

BEGIN 
    SELECT 
     tbldatostempcaptura2.iddatostempcaptura, 
     tbldatostempcaptura2.primernombre, 
     tbldatostempcaptura2.segundonombre, 
     tbldatostempcaptura2.primerapellido, 
     tbldatostempcaptura2.segundoapellido, 
     tbldatostempcaptura2.comentario, 
     tbldatostempcaptura2.fecharegistro, 
     tbdatosgeneralesciudadano.fechanacimiento, 
     tbdatosgeneralesciudadano.telefono, 
     tbusuarios.idusuario 
    FROM 
     tbldatostempcaptura2 
    INNER JOIN 
     tbdatosgeneralesciudadano 
    ON 
     tbldatostempcaptura2.iddatostempcaptura=tbdatosgeneralesciudadano.iddatostempcaptura 
    INNER JOIN 
     tbusuarios 
    ON 
     tbldatostempcaptura2.idusuario=tbusuarios.idusuario 
    WHERE 
     [email protected] 
END 

GO 
--exec reproted '2016/08/19' 
+0

ありがとうございました:D – Sameeeh

関連する問題