Abie Alvarez
Abie Alvarez

Reputation: 5

Crystal Report: How to use the Operator 'in' with if conditions

I added this crystal report formula but it does not proceed and displayed an error instead. Please see the below for reference.

enter image description here

" If {?@btype} = "All" then {Sp_StockEndingInventory_Batches;1.BATCH_TYPE_} in ('BATCHED', 'NON-BACTHED') else {?@btype}={?@btype}={Sp_StockEndingInventory_Batches;1.BATCH_TYPE_} "

Any ideas? Thanks in advance.

I tried to change the quotes from single to double but it still doesn't work.

Upvotes: 0

Views: 51

Answers (2)

MilletSoftware
MilletSoftware

Reputation: 4026

If the only 2 possible values are 'BATCHED' or 'NON-BACTHED' then the solution I suggested above should work as-is.

If there are other possible values, then use:

(
  {?@btype} = "All" AND 
  {Sp_StockEndingInventory_Batches;1.BATCH_TYPE_} in ('BATCHED', 'NON-BACTHED')
)
OR 
{?@btype}={Sp_StockEndingInventory_Batches;1.BATCH_TYPE_}

Upvotes: 0

MilletSoftware
MilletSoftware

Reputation: 4026

Try this instead:

{?@btype} = "All" OR {?@btype}={Sp_StockEndingInventory_Batches;1.BATCH_TYPE_}

Upvotes: 0

Related Questions