【发布时间】:2017-01-25 14:09:06
【问题描述】:
Cognos BI 版本:10.2.2 使用 Report Studio
我有一个带有一个提示 p1 的报告,它是一个基于 sql 查询的报告。
提示界面:
p1是一个DropdownList(使用值,显示值)
1-全部、2-值2、3-值3、4-值3
我正在尝试为 sql 查询添加基于条件的提示语法..
select col1, col2, col3, col4 from table1
where col4 is not null
case when #Prompt('p1')# = 1 then ' and 1=1'
when #Prompt('p1')# = 2 then ' and col1 is null and col2 is not null'
when #Prompt('p1')# = 3 then ' and col1 is not null and col2 is null'
when #Prompt('p1')# = 4 then ' and col1 is null and col2 is null'
end
我尝试在网上使用大量语法搜索,但找不到与我的场景相关的示例。我需要帮助以实现正确的语句编写方式以满足我的要求。感谢任何帮助..
【问题讨论】:
-
你的问题是?
-
对不起。我尝试在网上使用大量语法搜索,但找不到与我相关的示例。我需要帮助以实现正确的语句编写方式以满足我的要求。
标签: sql prompt cognos cognos-10 cognos-bi