Posted on 2009-02-16 14:13
非洲小白脸 阅读(305)
评论(0) 编辑 收藏 所属分类:
其他资源
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER PROCEDURE sp****(
@a AS VARCHAR(3),
@b AS VARCHAR(7),
@c AS CHAR(2),
@d AS VARCHAR(7)
) AS
BEGIN
DECLARE @NDTime varchar(50)
DECLARE @aOD VARCHAR(8)
DECLARE @dateDif INT
DECLARE @JRC VARCHAR(1)
/* 現在日時取得SP(sp****NowDate)を使用して、日時を取得する。 */
EXEC sp****NowDate @NDTime OUTPUT
SELECT @aOD = 字段
FROM ****
WHERE 字段 = @a
AND 字段 = @b
AND 字段 = @c
AND 字段 = d
SET @JRC= '1'
if datediff(d,Convert(datetime,@aOD),Convert(datetime,@NDT)) >= 180 begin
SET @JRC = '0'
end
SELECT @JRC ****
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO