Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selection formula 1

Status
Not open for further replies.

Ravala

Programmer
Jan 28, 2004
88
US
I have three input parameters and record selection formula looked like this:
{ORDER_PROC_V.ACCOUNT_ID} = {?Account_ID} and
{ORDER_PROC_V.SHIP_DATE} >= {?FromDate} and
{ORDER_PROC_V.SHIP_DATE} < DateAdd("d", 1, {?ToDate})
It worked fine until I inserted control structure and changed formula on:
if {?Account_id} in [20,21] then
{ORDER_PROC_V.ACCOUNT_ID} = {?Account_ID} and
{ORDER_PROC_V.SHIP_DATE} >= {?FromDate} and
{ORDER_PROC_V.SHIP_DATE} < DateAdd("d", 1, {?ToDate}) and
{ORDER_PROC_V.ORDER_TYPE} in ["HQ", "REGULAR"]
else
{ORDER_PROC_V.ACCOUNT_ID} = {?Account_ID} and
{ORDER_PROC_V.SHIP_DATE} >= {?FromDate} and
{ORDER_PROC_V.SHIP_DATE} < DateAdd("d", 1, {?ToDate})

It runs forever. What couls be a problem?
Please help.Thanks.
 
How are you linking the other records to {ORDER_PROC_V.ORDER_TYPE}? Try commenting it out, // in front, to check whether this is the source of the problem.

It helps to give your Crystal version, since newer versions have extra options, and some extra problems. I use Crystal 8.5.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Try this

(
{?Account_id} in [20,21] and
{ORDER_PROC_V.ACCOUNT_ID} = {?Account_ID} and
{ORDER_PROC_V.SHIP_DATE} in [{?FromDate} to {?ToDate}] and
{ORDER_PROC_V.ORDER_TYPE} in ["HQ", "REGULAR"]
)
or
(
not({?Account_id} in [20,21]) and
{ORDER_PROC_V.ACCOUNT_ID} = {?Account_ID} and
{ORDER_PROC_V.SHIP_DATE} in [{?FromDate} to {?ToDate}]
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top