Solved

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

Posted on 2009-04-14
6
1,928 Views
Last Modified: 2012-05-06
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?
0
Comment
Question by:ansvarit
  • 3
  • 3
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 24149308
If the date field is a string, why are you converting to a string?

mlmcc
0
 

Author Comment

by:ansvarit
ID: 24153300
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
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24153872
Have you tried the formula like this


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

mlmcc
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

Author Comment

by:ansvarit
ID: 24153898
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'.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 24159146
Then the field isn't a text/string but a number

Since the default for ToText is to add 2 decimals and commas try it this way
20090101 converts to this string  20,090,101.00
The commas and decimal places cause the trouble

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

mlmcc
0
 

Author Closing Comment

by:ansvarit
ID: 31570282
mlmcc - You're a gem. Issue resolved.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question