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.DATR PC}),4);
MM:=Mid(ToText({CMHR.DATRP C}), 5,2);
DD:=Right(ToText({CMHR.DAT RPC}),2);
DOLR:= DD & "/" & MM & "/" & YY;
CDate(DOLR);
----------------
When running the report through Crystal Reports XI; there are no issues.
Any ideas?
------------
//DRPT
StringVar YY;
StringVar MM;
StringVar DD;
StringVar DOLR;
YY:=Left(ToText({CMHR.DATR
MM:=Mid(ToText({CMHR.DATRP
DD:=Right(ToText({CMHR.DAT
DOLR:= DD & "/" & MM & "/" & YY;
CDate(DOLR);
----------------
When running the report through Crystal Reports XI; there are no issues.
Any ideas?
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
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
YY:=Left({CMHR.DATRPC},4);
MM:=Mid({CMHR.DATRPC}, 5,2);
DD:=Right({CMHR.DATRPC},2)
mlmcc
ASKER
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'.
mlmcc - When changing I get an error 'A String Is Required Here'.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mlmcc - You're a gem. Issue resolved.
mlmcc