I’m pretty new to Crystal and have actually managed to put together my first half decent report but i cannot for the life of me get the date range to work.
I want the report to show all calls on hold awaiting parts between 2 selected dates.
How do i set my parameters up and what am i missing in the formula that is giving not showing me the dates ranges i want.
This is what i have under the select expert…
[b][i]if {?Hold Status} = “On Hold” then {THREAD.AWAIT_PARTS} = “Y”
else
if {?Hold Status} = “Not On Hold” then {THREAD.AWAIT_PARTS} = “N”
and
{THREAD.BOOKING_DATE} in {?Start Date} to {?Stop Date}
and
if {?Thread Status} = 1 then {THREAD.THREAD_STATUS} = 1
else
if {?Thread Status} = 15 then {THREAD.THREAD_STATUS} = 15[/i][/b]
Any help would be appreciated as this is actually doing my head in!!!
if you can, you want to stay away from IF-then-else logic in the record selection formula because Crystal may not be able to translate it into the proper sql syntax.
Maybe try instead:
{THREAD.BOOKING_DATE} in {?Start Date} to {?Stop Date}
and
(
( {?Hold Status} = “On Hold” and {THREAD.AWAIT_PARTS} = “Y”)
or
( {?Hold Status} = “Not On Hold” and {THREAD.AWAIT_PARTS} = “N”)
)
and
(
( {?Thread Status} = 1 and {THREAD.THREAD_STATUS} = 1)
or
( {?Thread Status} = 15 and {THREAD.THREAD_STATUS} = 15)
)
If the only values allowed for the Thread Status prompt are 1 and 15 it could be shortened to:
{THREAD.BOOKING_DATE} in {?Start Date} to {?Stop Date}
and
(
( {?Hold Status} = “On Hold” and {THREAD.AWAIT_PARTS} = “Y”)
or
( {?Hold Status} = “Not On Hold” and {THREAD.AWAIT_PARTS} = “N”)
)
and
( {?Thread Status} = {THREAD.THREAD_STATUS})