I have a order_product table like this:
orderid productid productname
100 1 A
100 2 B
100 3 C
101 1 A
102 3 C
In the front end,user has a dropdown which has got product names.
It's ok when user makes single selection (like A or B or C).
In the crystal reports, I have taken a parameter field {?product} and is working fine with the following:
if ({?product} = "A") then
(
{ORDER_PRODUCT.PRODUCTID}= 1
)
else if ({?product} = "B") then
(
{ORDER_PRODUCT.PRODUCTID} = 2
)
But when user selects multiple products, then I am unable to implement in crystal reports.
The following one cannot work out and is resulting in the no output as there wont be any orderid with both productid as 1 and 2 at the same time.
If ({?product} ="A+B") then
(
{ORDER_PRODUCT.PRODUCTID}=2 AND {ORDER_PRODUCT.PRODUCTID}=1
)
In the above, writing
If({?product} = "A+B")is ok
but can anyone change the part
{ORDER_PRODUCT.PRODUCTID}=2 AND {ORDER_PRODUCT.PRODUCTID}=1 to fit my requirement.
orderid productid productname
100 1 A
100 2 B
100 3 C
101 1 A
102 3 C
In the front end,user has a dropdown which has got product names.
It's ok when user makes single selection (like A or B or C).
In the crystal reports, I have taken a parameter field {?product} and is working fine with the following:
if ({?product} = "A") then
(
{ORDER_PRODUCT.PRODUCTID}= 1
)
else if ({?product} = "B") then
(
{ORDER_PRODUCT.PRODUCTID} = 2
)
But when user selects multiple products, then I am unable to implement in crystal reports.
The following one cannot work out and is resulting in the no output as there wont be any orderid with both productid as 1 and 2 at the same time.
If ({?product} ="A+B") then
(
{ORDER_PRODUCT.PRODUCTID}=2 AND {ORDER_PRODUCT.PRODUCTID}=1
)
In the above, writing
If({?product} = "A+B")is ok
but can anyone change the part
{ORDER_PRODUCT.PRODUCTID}=2 AND {ORDER_PRODUCT.PRODUCTID}=1 to fit my requirement.