Buy Now
Sign in

Or condition in where clause

webcrea , October 09 at 11:00
webcrea

Hi,

In read_data in where conditions I have

fonds.notreSelection:{data:notre_selection}/-
fonds.published:{data:cbox_published}/-
fonds.sg_id:{data:select_sg}/-
fonds.natureProduit:{data:select_type}/-
fonds.natureProduit1:{data:select_type}/-
fonds.millesime:{data:select_mille}/-

and i would want something like this

fonds.notreSelection:{data:notre_selection}/-
fonds.published:{data:cbox_published}/-
fonds.sg_id:{data:select_sg}/-
fonds.natureProduit:{data:select_type}/- OR fonds.natureProduit1:{data:select_type}/-
fonds.millesime:{data:select_mille}/-

Do you nhave any idea please ?
thanks

Christophe
http://www.webcrea.fr

admin

Hi Christophe,

You can use different strings in the conditions box to build a complex query:

				
fonds.notreSelection:{data:notre_selection}/-
AND
(
fonds.notreSelection:{data:notre_selection}/-
OR
fonds.notreSelection:{data:notre_selection}/-
)


Best regards

Max
If your main question got answered then please mark the answer using the button!

webcrea

Thanks Max,

fonds.millesime:{data:select_mille}/-
AND
(
fonds.natureProduit:{data:select_type}
OR
fonds.natureProduit1:{data:select_type}
)

no /- at the end

Christophe
http://www.webcrea.fr

webcrea

With this, it works but if 2 fields (natureProduit and natureProduit1) are not empty the data doesn't appear. The filter select_type is empty '' and only data with one field empty appears.

If I add /- an at the end error occurs

fonds.notreSelection:{data:notre_selection}/-
fonds.published:{data:cbox_published}/-
fonds.sg_id:{data:select_sg}/-
fonds.millesime:{data:select_mille}/-
AND
(
fonds.natureProduit:{data:select_type}
OR
fonds.natureProduit1:{data:select_type}
)

I need this AND (OR) doesn't work if select_type is empty.
Do you know what I mean?
Thanks
Regards

Christophe
http://www.webcrea.fr

admin

Hi Christophe,

Apologizes for the late reply here!

You can use PHP code in the conditions box in order to switch the returned active conditions.

Best regards

Max
If your main question got answered then please mark the answer using the button!

webcrea

Thanks Max

Christophe
http://www.webcrea.fr