Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax for an expression

Status
Not open for further replies.

ebell1

Technical User
Nov 10, 2010
4
US
I have a Crystal Report that I am converting to SSRS. In a formula in Crystal Report it uses a not one of. See the example below:
whileprintingrecords;
numbervar sample;
if {pr_proj_job_pay.a_job_class_code} <> "XXXX" and {pr_proj_job_pay.a_pay_type}in [10, 20, 30] then
sample := 0
else if {pr_proj_ded_ben.a_deduction_code} in [21,22] and {pr_proj_job_pay.a_job_class_code} <> "XXXX" then
sample := {pr_proj_ded_ben.d_emplr_ann}
else if {pr_proj_ded_ben.a_deduction_code} = 21 and {pr_proj_job_pay.a_job_class_code} = "XXXX"
and not ({pr_proj_job_pay.a_pay_type} in [120, 150, 160, 170, 171, 172, 173, 174, 175, 180, 181, 185,
186, 187, 188, 198, 220, 225, 300, 318, 319, 351, 352, 362, 450, 451, 452, 453, 454, 502, 509, 512,
513, 550, 551, 552, 555, 560, 565, 580, 700, 750, 901, 902, 903, 904, 905, 906, 907, 950, 988, 999])
then sample := {pr_proj_job_pay.s_reference_salary} * .111
else if {pr_proj_ded_ben.a_deduction_code} = 22 and {pr_proj_job_pay.a_job_class_code} = "XXXX" and
not ({pr_proj_job_pay.a_pay_type} in [130, 150, 160, 170, 171, 172, 173, 174, 175, 180, 181, 185, 186,
187, 188, 198, 220, 225, 300, 318, 319, 351, 352, 362, 450, 451, 452, 453, 454, 502, 509, 512, 513,
550, 551, 552, 555, 560, 565, 580, 700, 750, 901, 902, 903, 904, 905, 906, 907, 950, 988, 999])
then sample := {pr_proj_job_pay.s_reference_salary} * .005;
sample

What would I use in place of the not in?
 
Personally, after taking some meds after looking at your expression, I would convert this to a CASE statement in my underlying query and not put it in the report itself. If it must be in the report, as far as I know, the expression is going to be a real mess. The CASE statement is going to make things much more readable and manageable.

Gary
gwinn7
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top