【问题标题】:Reportbuilder data set errors with good SQL?具有良好 SQL 的 Reportbuilder 数据集错误?
【发布时间】:2019-10-01 23:38:49
【问题描述】:

我有一个bigint 状态,其中设置了按位标志,我正在尝试制作报告以使用此信息,我的代码去了

cast(foo.State & 0x0 as bit)&1 as Case1,
cast(foo.State & 0x1 as bit)&1 as Case2,
cast(foo.State & 0x2 as bit)&1 as Case3,
cast(foo.State & 0x4 as bit)&1 as Case4,
cast(foo.State & 0x8 as bit)&1 as Case5,

但是当我尝试将 2 位组合成一个唯一状态时它失败了,

我试过了:

(cast(foo.State & 0x4 as bit) and cast(foo.State & 0x8 as bit)) as CaseBar

还有

Case foo.State & 0xc when 12 then 1 else 0 end as CaseBar

这两个在 SQL 查询中运行良好,但在 reportbuilder 数据集属性中失败,这里有任何反馈或指针吗?

【问题讨论】:

    标签: sql-server reportbuilder3.0


    【解决方案1】:

    实现它的方法是:

    cast((cast(foo.State & 0x8 as bit) & Cast(foo.State & 0x4 as bit)) as bit)&1 as CaseBar,
    

    问题是报告生成器引擎不支持完整的 TSQL 命令集

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-17
      • 1970-01-01
      • 2014-07-13
      • 2011-02-04
      • 2020-10-30
      • 2019-07-25
      • 2010-09-14
      • 2018-01-27
      相关资源
      最近更新 更多