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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula not working

Status
Not open for further replies.

Kibeth

Technical User
Feb 13, 2007
28
US
I am using the following formula to find the Due Date of an order, but I am getting an error saying I need a number on the 4th line instead of a field. Does anyone have a workaround for this? I am using CR XI. Thank!

WhileReadingRecords;
DateVar Array Holidays;
DateVar Target:={@OrderDate}; // Put your field name in here
NumberVar Add:= ({@SLA}); // put the number of days here to add (a positive number)
NumberVar Added := 0;

WHILE Added < Add
Do (target := target +1;
if dayofweek (target) in 2 to 6 and not (target in holidays)
then Added:=Added+1
else Added:=Added);
Target
 
Please post yourformulas for @SLA and @OrderDate

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"A fine is a tax for doing wrong. A tax is a fine for doing well.
" - unknown
 
@ Order Date is simply:
cdate({ORDERS.ORD_DATE})
@SLA is:
IF {VIW_ORDER_DETAIL_REPORT.SKUID} = "01006194" THEN "0" ELSE
repeating 100+ times with a different number for each SKUID.
 
If you put quotes around a number, it's no longer a number, it's a string.

Try:

WhileReadingRecords;
DateVar Array Holidays;
DateVar Target:={@OrderDate};
NumberVar Add:= tonumber({@SLA});
NumberVar Added := 0;

WHILE Added < Add
Do (target := target +1;
if dayofweek (target) in 2 to 6 and not (target in holidays)
then Added:=Added+1
else Added:=Added);
Target

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top