【问题标题】:Passing data parameters on SSRS using snowflake datasoruce使用雪花数据源在 SSRS 上传递数据参数
【发布时间】: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

有人可以帮忙吗?

使用以下链接作为传递参数的参考: https://community.snowflake.com/s/question/0D50Z00007DAa4MSAT/has-anyone-use-snowflake-as-datasource-for-mssql-ssrs-report-if-you-do-how-to-pass-a-vaiable-to-snowsql-from-ssrs

谢谢

【问题讨论】:

  • 我对雪花一无所知,但使用这样的双引号不能正确表达。我期待更像="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


【解决方案1】:

表达式不正确,如果您需要在 SLECT 语句中使用双引号,那么您必须像这样使用双引号对。

="select * from ""Snowflake"".Past"".""Customer"" where cast(""startdate"" as date)  = '"  & Parameters!mydate.Value & "';"

此外,您已转换为 Date 类型,但与 string 相比,我不确定这是否可以?我对雪花一无所知,所以可能没问题

【讨论】:

    猜你喜欢
    • 2022-10-13
    • 1970-01-01
    • 1970-01-01
    • 2021-07-23
    • 1970-01-01
    • 1970-01-01
    • 2022-06-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多