Link to home
Start Free TrialLog in
Avatar of ansvarit
ansvarit

asked on

InfoView - Bad Date Format String Details: errorKind (?)

Infoview Only - I'm running a report that builds a date field from a string and fails on the first line of the following formula.
------------
//DRPT
StringVar YY;
StringVar MM;
StringVar DD;
StringVar DOLR;
YY:=Left(ToText({CMHR.DATRPC}),4);
MM:=Mid(ToText({CMHR.DATRPC}), 5,2);
DD:=Right(ToText({CMHR.DATRPC}),2);
DOLR:= DD & "/" & MM & "/" & YY;
CDate(DOLR);
----------------

When running the report through Crystal Reports XI; there are no issues.

Any ideas?
Avatar of Mike McCracken
Mike McCracken

If the date field is a string, why are you converting to a string?

mlmcc
Avatar of ansvarit

ASKER

mlmcc;

I'm taking a field from our database that is a string date; 20090101
I'm breaking up the string; and then rebuilding to format in Australia date format.
Then the string is converted to a date variable for display only. CDate ()

Essentially; the error on Infoview is coming back before reading any data, and is even erroring on the commented field //DRPT
Have you tried the formula like this


YY:=Left({CMHR.DATRPC},4);
MM:=Mid({CMHR.DATRPC}, 5,2);
DD:=Right({CMHR.DATRPC},2);

mlmcc
Apologies; upon double checking. The original field is a NUMBER field not a string. Thus the transformation to a STRING via the TOTEXT function.

mlmcc - When changing I get an error 'A String Is Required Here'.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
mlmcc - You're a gem. Issue resolved.