Hi, I've inserted the following formula into the select expert -
{v_recon_operation_process_sub.rental_period} > 2 and
({billing_months.id} = {?Period} and
{v_recon_operation_process_sub.asset_status} = "Billable" and
{v_recon_operation_process_sub.asset_type} = "Rental" and
{discount_accounts.discount_type} = "Not Discounted" ) OR
(ISNULL({discount_accounts.id}) and
{billing_months.id} = {?Period} and
{v_recon_operation_process_sub.asset_status} = "Billable" and
{v_recon_operation_process_sub.asset_type} = "Rental")
but the query look as follows
WHERE ("v_recon_operation_process_sub"."rental_period">2 AND "billing_months"."id"=72 AND "v_recon_operation_process_sub"."asset_status"='Billable' AND "v_recon_operation_process_sub"."asset_type"='Rental' AND "discount_accounts"."discount_type"='Not Discounted' OR "discount_accounts"."id" IS NULL AND "billing_months"."id"=72 AND "v_recon_operation_process_sub"."asset_status"='Billable' AND "v_recon_operation_process_sub"."asset_type"='Rental').
Why do crystal throw away my brackets that I inserted between the OR. Without the brackets the query return the wrong values. I've tested both the queries,with and without the brakcets in PgAdmin3.
{v_recon_operation_process_sub.rental_period} > 2 and
({billing_months.id} = {?Period} and
{v_recon_operation_process_sub.asset_status} = "Billable" and
{v_recon_operation_process_sub.asset_type} = "Rental" and
{discount_accounts.discount_type} = "Not Discounted" ) OR
(ISNULL({discount_accounts.id}) and
{billing_months.id} = {?Period} and
{v_recon_operation_process_sub.asset_status} = "Billable" and
{v_recon_operation_process_sub.asset_type} = "Rental")
but the query look as follows
WHERE ("v_recon_operation_process_sub"."rental_period">2 AND "billing_months"."id"=72 AND "v_recon_operation_process_sub"."asset_status"='Billable' AND "v_recon_operation_process_sub"."asset_type"='Rental' AND "discount_accounts"."discount_type"='Not Discounted' OR "discount_accounts"."id" IS NULL AND "billing_months"."id"=72 AND "v_recon_operation_process_sub"."asset_status"='Billable' AND "v_recon_operation_process_sub"."asset_type"='Rental').
Why do crystal throw away my brackets that I inserted between the OR. Without the brackets the query return the wrong values. I've tested both the queries,with and without the brakcets in PgAdmin3.