If Hilfy's suggestion does not work I would leave your original but use the parentheses the way Hilfy was. It has worked fine for me that way in the past...
{WORK_ORDER.CLOSE_DATE} >= Minimum({?DateRange}) and
{WORK_ORDER.CLOSE_DATE} <=Maximum({?DateRange})
and
(If {?PartID}='ALL Parts'
Then {CUST_ORDER_LINE.PART_ID} like '*'
Else {CUST_ORDER_LINE.PART_ID} = {?PartID})
and
(If {?CustID}='ALL Customers'
Then {CUSTOMER_ORDER.CUSTOMER_ID} like '*'
Else {CUSTOMER_ORDER.CUSTOMER_ID} = {?CustID})
Although I think I would have changed your date parmeter into two fields Begin date and End date and then use an in statement for the first part...
{WORK_ORDER.CLOSE_DATE} in {?Begin Date} to {?End Date}
and
(If {?PartID}='ALL Parts'
Then {CUST_ORDER_LINE.PART_ID} like '*'
Else {CUST_ORDER_LINE.PART_ID} = {?PartID})
and
(If {?CustID}='ALL Customers'
Then {CUSTOMER_ORDER.CUSTOMER_ID} like '*'
Else {CUSTOMER_ORDER.CUSTOMER_ID} = {?CustID})
if that does not work you can reverse the logic and make the else statement a little odd as just equal to itself which also should work...
{WORK_ORDER.CLOSE_DATE} in {?Begin Date} to {?End Date}
and
(If {?PartID}<>'ALL Parts'
Then {CUST_ORDER_LINE.PART_ID} = {?PartID} else {CUST_ORDER_LINE.PART_ID}={CUST_ORDER_LINE.PART_ID})
and
(If {?CustID}<>'ALL Customers'
Then {CUSTOMER_ORDER.CUSTOMER_ID} = {?CustID} else {CUSTOMER_ORDER.CUSTOMER_ID}={CUSTOMER_ORDER.CUSTOMER_ID})
Edited by DBlank - 08 Jun 2009 at 2:01pm