In an existing ssrs 2008 r2 application, I am having a problem trying to understand the existing logic.
I am hoping you can it explain the logic to me of how the parts are tied together for both part 1
and part 2:
1. The following is Part 1:
a. The main sql the
SELECT
sum(case when @AbsT like '%UN1%'
then [absUN1]
else 0 end) +
sum(case when @AbsT like '%AB1%'
then [absAB1]
else 0 end) +
sum(case when @AbsT like '%IL1%'
then [absIL1]
else 0 end) +
sum(case when @AbsT like '%ME1%'
then [absME1]
else 0 end) +
sum(case when @AbsT like '%SU1%'
then [absSU1]
else 0 end) +
sum(case when @AbsT like '%TR1%'
then [absTR1]
else 0 end) as SelectedAb1
FROM [OP1].[dbo].[AttReport]
where SelectedAb1 > isnull(@AMin,-1)
and SelectedAb1 <= isnull(@AMax,100)
b. The following is the dataset and parameter that refer to the sql above:
@AbsT is the parameter
select 'AB1' as value, 'Absent (ABS)' as Label
union
select 'IL1', 'Ill (ILL)'
union
select 'ME1','Medical (MED)'
union
select 'SU1','Sus (SUS)'
union
select 'TR1','Tru (TRU)'
union
select 'UN1','Unverify (UNV)'
Can you explain to me how the parameter listed above is used by the sql listed above?
2. The following is part 2:
a. The following is the sql behind the parameter called AbsMinMax
select 0 as Num
union
select 1
union
select 2
union
select 3
union
select 4
union
select 5
b. the following are the parameter values a user enters:
@AMin as int,
@AMax as int,
c. the following is the where clause:
where SelectedAb1 > isnull(@AMin,-1)
and SelectedAb1 <= isnull(@AMax,100)
Can you explain how the items listed under part 2 are tied together? Can you explain he logic?