I'm using Crystal Reports 2008 with Peachtree 2011, a pervasive sql database engine.
I created a report to list sales orders and invoices with inventory item information.
I want the report to pull open sales orders, closed sales orders or both depending on what the user enters in the sales order status parameter.
Peachtree has a field, JrnlHdr.POSOisclosed. This field has a 0 if the sales order is open or a 1 if the sales order is closed. I have a formula {@SO Status} = If {JrnlHdr_SO.POSOisClosed} = 1 then "Closed" else "Open".
The parameter {?Sales Order Status} is setup with the values:
Both
Open
Closed
The Value Options of the parameter include:
Prompt with Description Only: False
Optional Prompt: True
Default Value: blank
Allow Custom Values: True
Allow Multiple Values: False
Allow Discrete Values: True
Allow Range Values: False
No Minimum or maximum length
No Edit Mask
I need help with the selection formula.
The formula currently reads:
and
(not HasValue({?Sales Order Status}) or (If {?Sales Order Status} = "Both" then True
else (If {?Sales Order Status} = "Open" then {JrnlHdr_SO.POSOisClosed} = 0))) or
else (If {?Sales Order Status} = "Closed" then {JrnlHdr_SO.POSOisClosed} = 1))
I get an error (with the cursor highlighting the last "else"):
A number, currency amount, boolean, date, time, date-time, or string is expected here.
How can I fix the selection formula so if the user selects "Open" only the open sales orders appear, or if the user selects "Closed" only the closed sales order appear or if the user selects "Both", all sales orders appear on the report?
Thank you in advance for your help.
I created a report to list sales orders and invoices with inventory item information.
I want the report to pull open sales orders, closed sales orders or both depending on what the user enters in the sales order status parameter.
Peachtree has a field, JrnlHdr.POSOisclosed. This field has a 0 if the sales order is open or a 1 if the sales order is closed. I have a formula {@SO Status} = If {JrnlHdr_SO.POSOisClosed} = 1 then "Closed" else "Open".
The parameter {?Sales Order Status} is setup with the values:
Both
Open
Closed
The Value Options of the parameter include:
Prompt with Description Only: False
Optional Prompt: True
Default Value: blank
Allow Custom Values: True
Allow Multiple Values: False
Allow Discrete Values: True
Allow Range Values: False
No Minimum or maximum length
No Edit Mask
I need help with the selection formula.
The formula currently reads:
and
(not HasValue({?Sales Order Status}) or (If {?Sales Order Status} = "Both" then True
else (If {?Sales Order Status} = "Open" then {JrnlHdr_SO.POSOisClosed} = 0))) or
else (If {?Sales Order Status} = "Closed" then {JrnlHdr_SO.POSOisClosed} = 1))
I get an error (with the cursor highlighting the last "else"):
A number, currency amount, boolean, date, time, date-time, or string is expected here.
How can I fix the selection formula so if the user selects "Open" only the open sales orders appear, or if the user selects "Closed" only the closed sales order appear or if the user selects "Both", all sales orders appear on the report?
Thank you in advance for your help.