Here’s the formula that’s giving me the error:
@For(n := 1; n <= @Elements(plantchoices); n := n + 1;
total := “”;
total:=total:@Text(@TextToNumber (temp1[n])+@TextToNumber (temp2[n])+@TextToNumber (temp3[n])+@TextToNumber (temp4[n])+@TextToNumber (temp5[n])+@TextToNumber (temp6[n])+@TextToNumber (temp7[n])+@TextToNumber (temp8[n])+@TextToNumber (temp9[n])+@TextToNumber (temp10[n])+@TextToNumber (temp11[n])+@TextToNumber (temp12[n]))
);
@If(@IsError(total);“0”;@Trim(total))
Plantchoices is a computed for display field that holds the choices of a checkbox as they’re checked.
The temp1 to temp12 fields calculate items in an order for each month that is in a date range. An example code for one of these fields is here:
aa := @Subset(@DbName; 1);
bb := @LeftBack(@Subset(@DbName; -1); “\”) + “\sales.nsf”;
thismonth:=@Adjust(fromdate;0;5;0;0;0;0);
firstdayofmonth:=@Date(@Year(thismonth);@Month(thismonth);1);
lastdayofmonth:= @Day(@Adjust(firstdayofmonth;0;1;-1;0;0;0));
endday:= @If(@Month(thismonth) = @Month(todate);@Day(todate);lastdayofmonth);
startday:= 1;
@If(@Middle(monthcheck;5;1) = “0”;@Return(“0”);
@For(n := 1; n <= @Elements(plantchoices); n := n + 1;
thewarehouse := @Trim(@Right(plantchoices[n];4));
newthing := “”;
thing := “”;
@For(DateNum := startday; DateNum <= endday; DateNum := DateNum + 1;
TheDateToUse:=@Adjust(firstdayofmonth;0;0;DateNum;0;0;0);
key := @Text(@Year(TheDateToUse)) + @Trim(@Right(“0”+@Text(@Month(thedatetouse));2)) + @Trim(@Right(“0” + @Text(@Day(TheDateToUse));2))+ @Trim(@Text(@Trim(thewarehouse)));
key2 := @Text(@Year(TheDateToUse)) + @Trim(@Right(“0”+@Text(@Month(thedatetouse));2)) + @Trim(@Right(“0” + @Text(@Day(TheDateToUse));2))+ @Trim(@Text(@Trim(thewarehouse)))+ “YY”;
key3 := @Text(@Year(TheDateToUse)) + @Trim(@Right(“0”+@Text(@Month(thedatetouse));2)) + @Trim(@Right(“0” + @Text(@Day(TheDateToUse));2))+@Trim(@Text(@Trim(thewarehouse)))+ “ZZ”;
thing:=@If (@IsError(
@DbLookup(“”:“Cache”;aa:bb; “(InvoicesByQtyWarehouse)”;@Trim(key);2));“0”;@DbLookup(“”:“Cache”;aa:bb; “(InvoicesByQtyWarehouse)”;key;2));
YY := @If (@IsError(
@DbLookup(“”:“Cache”;aa:bb; “(InvoicesByPartWarehouse)”;key2;2));“0”;@DbLookup(“”:“Cache”;aa:bb; “(InvoicesByPartWarehouse)”;key2;2));
ZZ := @If (@IsError(
@DbLookup(“”:“Cache”;aa:bb; “(InvoicesByPartWarehouse)”;key3;2));“0”;@DbLookup(“”:“Cache”;aa:bb; “(InvoicesByPartWarehouse)”;key3;2));
newthing := newthing:@Text(@Round(@TextToNumber(thing)-@TextToNumber(YY)-@TextToNumber(ZZ)))
);
blah:=blah:@If(@Text(@Sum(@TextToNumber(@Text(@Trim(newthing))))) = “@ERROR”;“stup”;@Text(@Sum(@TextToNumber(@Text(@Trim(newthing))))))
));
@Trim(blah)
The first formula at the top is the one giving me the error.
Thanks for any help
KB