DECLARE @remain VARCHAR(max)
DECLARE @MID VARCHAR(255) SET @MID=5
SET @remain='SELECT DATEDIFF(dd,GETDATE(),DateAdd(mm, mt.ValidMonth, py.UpdatedDate-1))
FROM Payment.PaymentTransaction py
INNER JOIN Member.BasicInfo B3 ON b3.MemberID=py.MemberID
INNER JOIN Master.MemberType mt ON mt.MemberTypeID=b3.MemberTypeID
WHERE '
SET @remain=@remain +'b3.MemberID='+@MID
PRINT @remain
EXEC(@remain)
Note:(make sure your all declare variable must be same data type)
DECLARE @MID VARCHAR(255) SET @MID=5
SET @remain='SELECT DATEDIFF(dd,GETDATE(),DateAdd(mm, mt.ValidMonth, py.UpdatedDate-1))
FROM Payment.PaymentTransaction py
INNER JOIN Member.BasicInfo B3 ON b3.MemberID=py.MemberID
INNER JOIN Master.MemberType mt ON mt.MemberTypeID=b3.MemberTypeID
WHERE '
SET @remain=@remain +'b3.MemberID='+@MID
PRINT @remain
EXEC(@remain)
Note:(make sure your all declare variable must be same data type)
No comments:
Post a Comment