簡體   English   中英

報表生成器3.0-SQL填充前一個為空時的提示

[英]Report Builder 3.0 - SQL to fill in a prompt when the previous one is null

我的報告中有3條提示:(1)組號,(2)狀態和(3)分支。 用戶選擇組號(1),並使用該組開展業務的所有狀態更新狀態(2)的提示。然后用戶從狀態提示(2)中選擇“空”或狀態之一。 當他們進行狀態選擇時,分支提示(3)使用以下sql完成:

select distinct
bta.stn_stn_id
from ody.bil_tas_areas bta
where 
bta.stpr_id = (select uda.area_id
from ody.usr_dfnd_areas uda
where uda.aty_area_typ = 'tas_a_stpr'
and uda.AREA_DESC = ?)
order by 1

當他們進行除“ null”以外的任何選擇時,這將很好地工作。 如果他們選擇“ null”,並希望針對所有狀態運行報告,那么我希望查看組號的所有分支。 當前,第三個提示為空。 我不確定選擇“ null”時如何獲取所有分支。 任何幫助,將不勝感激。 謝謝.......

選擇“空”時,可以嘗試這種方式來獲取所有分支。

select distinct
bta.stn_stn_id
from ody.bil_tas_areas bta
where 
bta.stpr_id = 
(
    select uda.area_id
    from ody.usr_dfnd_areas uda
    where uda.aty_area_typ = 'tas_a_stpr'
    and (uda.AREA_DESC = ? or 'null' = ?)
)
order by 1

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM