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

Conflict between CR and CE 1

Status
Not open for further replies.

JHeimall

MIS
Nov 8, 2002
14
US
We are still running CR AND CE 8.5 here, but plan to upgrade soon. Right now, I have a problem with a report that will run perfectly fine in CR, but gives me an error when I run it with the same parameters on CE. The error message I am receiving tells me

Error in formula <Over>
Stringvar CDStringb:=TOTEXT({@BatchDate});
'
The string in non-numeric...

Has anyone else had problems with reports in CE that ran fine in CR?

My code for this formula is:
StringVar CDStringb := TOTEXT({@BatchDate});
StringVar CDStringc := (LEFT(CDStringb,2)) & RIGHT(LEFT(CDSTRINGb,5),2);
StringVar CDStringd := TOTEXT(CurrentDate);
StringVar Y1:=Right(CDStringb,4);
StringVar Y2:=Right(CDStringD,4);
StringVar M1:=Left(CDStringb,2);
StringVar M2:=Left(CDStringD,2);
StringVar D1:=Right(Left(CDStringb,5),2);
StringVar D2:=Right(Left(CDStringD,5),2);
StringVar Result:= "";
IF CDStringC ="0229" then
D1="28";
IF IIF(ISNUMERIC(Y2) AND ISNUMERIC(Y1),TONUMBER(Y2)-2 > TONUMBER(Y1),FALSE) THEN
"X"
Else IF IIF(ISNUMERIC(Y2) AND ISNUMERIC(Y1),TONUMBER(Y2)-2 < TONUMBER(Y1),FALSE) THEN
" "
Else IF IIF(ISNUMERIC(M2) AND ISNUMERIC(M1),TONUMBER(M2)-2 > TONUMBER(M1),FALSE) THEN
"X"
Else IF IIF(ISNUMERIC(M2) AND ISNUMERIC(M1),TONUMBER(M2)-2 < TONUMBER(M1),FALSE) THEN
" "
Else IF IIF(ISNUMERIC(D2) AND ISNUMERIC(D1),TONUMBER(D2)-2 > TONUMBER(D1),FALSE) THEN
"X"
Else
" "

Any help would be great! THANKS!!
 
This could be the result of dates being different on CE.

Try using more meaningful variable names, and use date functions instead of an assumed placement.

For example the year should be pulled using:

totext(year({table.date}),0,"")

Month:

totext(month({table.date}))

Day:

totext(day({table.date}))

I'd rewrite the formula but I'd probably get something wrong in the IIFs as I don't spend too much time on any one post. I tend to not use IIFs in general for maintenance reasons as they tend to get convoluted.

You might look at the SWITCH function, it tends to be a bit cleaner and lends itself to this.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top