Solved

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

Posted on 2009-04-14
6
1,917 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Execute a crystal report from vb2010 3 39
Store code inside oracle BLOB column 7 42
How to add a total 6 33
New and Previous Value in Crystal Report 8 53
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

15 Experts available now in Live!

Get 1:1 Help Now