我定义了一个模版参数$1,然后在单元格=$1
发现在报表打开后,页面中不是运行的值,还是这段代码。
44726
但是把这段代码放成单元格中,打开报表就会运行得到值,是参数不会运行SQL吗?
sql("test", "
SET NOCOUNT ON
UPDATE x01
SET dd = dd + 1
FROM x01
WHERE nd = YEAR(GETDATE())
AND yf = MONTH(GETDATE());
SELECT RIGHT('0' + LTRIM(CONVERT(VARCHAR(4), GETDATE(), 112)), 2)
+ RIGHT('00' + CAST(MONTH(GETDATE()) AS VARCHAR(4)), 2)
+ RIGHT('000000000' + CAST(dd - 1 AS VARCHAR(8)), 8)
AS ddhm
FROM x01
WHERE nd = YEAR(GETDATE())
AND yf = MONTH(GETDATE());
SET NOCOUNT OFF
", 1, 1)