Solved

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

Posted on 2009-04-14
6
1,909 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
Comment Utility
If the date field is a string, why are you converting to a string?

mlmcc
0
 

Author Comment

by:ansvarit
Comment Utility
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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:ansvarit
Comment Utility
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
Comment Utility
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
Comment Utility
mlmcc - You're a gem. Issue resolved.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now