【发布时间】:2021-08-06 21:58:05
【问题描述】:
我使用snowflake 作为ssrs 报告的数据源。我正在尝试通过将我的查询添加为 expr 来传递参数。
这是我迄今为止尝试过的:
="select * from "Snowflake"."Past"."Customer"
where cast("startdate" as date) = '" Parameters!mydate.Value"';"
当我尝试Refresh Fields 时,没有任何内容被填充,事实上我收到了错误Customers data has no fields
当我尝试点击Run 时,我收到了错误[BC30205] End of statement expected。
有人可以帮忙吗?
谢谢
【问题讨论】:
-
我对雪花一无所知,但使用这样的双引号不能正确表达。我期待更像
="select * from Snowflake.Past.Customer where cast(startdate as date) = '" & Parameters!mydate.Value & "';" -
嗨@AlanSchofield,双引号是必须调用数据源的方式,否则它将无法工作:/
-
好的,这意味着您必须使用双引号对,否则表达式无效。
="select * from ""Snowflake"".Past"".""Customer"" where cast(""startdate"" as date) = '" & Parameters!mydate.Value & "';"。此外,您已转换为Date类型,但与字符串相比,我不确定这是否可以?我对雪花一无所知,所以可能没问题。 -
@AlanSchofield 感谢您的帮助:)
-
没问题。我会将其添加为答案,以便您将其标记为已接受,这将有助于其他人在未来寻找类似的解决方案
标签: reporting-services parameters parameter-passing snowflake-cloud-data-platform