Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crys10 Next Page Issue 1

Status
Not open for further replies.

ProgEval

MIS
Sep 21, 2006
59
US
I have a Crystal Report that has dates and formulas based on dates. The formula includes string converted to dates(cdate()). When I run the report it shows perfect on the screen (Page 1). Although, when I try to see page 2, it takes me to the formula editor of one of my date formulas. I don't understand why one page shows correctly, but it gives me an problem when I go to the next page.

Any ideas on what might be going on here? I can't figure it out. I am using Crystal 10 with service packs 5 & 6.

Thanks in advance.
 
Please show the content of the date formula that is showing up, along with the content of the error message.

-LB
 
The formula is....
cdate({View__Annual_Renewal_Report.RenewalDate<String>})- cdate({View__Annual_Renewal_Report.RenewaLetterSentDate<String>})

The result of this calculation is okay when I test it in the formula editor and it shows correctly on page 1 when I run the report.

When I go to page two I get the error "Bad date format string." and it goes to the above formula in formula editor.

Thanks.
 
It would help to see how your string date displays before you convert it. Also, I wonder whether you are running into a null. You could also try the following:

if isnull({View__Annual_Renewal_Report.RenewalDate<String>})or
trim({View__Annual_Renewal_Report.RenewalDate<String>}) = "" or
isnull({View__Annual_Renewal_Report.RenewalDate<String>}) or
trim({View__Annual_Renewal_Report.RenewalDate<String>}) = "" then
0 else
cdate({View__Annual_Renewal_Report.RenewalDate<String>})- cdate({View__Annual_Renewal_Report.RenewaLetterSentDate<String>})

If this allows your report to work, then you can decide whether you want some other result besides zero when you hit a null. If this still doesn't work, then you need to look at your string date and note any oddities in the way it is entered.

-LB
 
I think this solves my problem! Thanks so much for the help. I appreciate it.
 
lbass,

In the above equation, how do I make the calculated field blank/null if the date field is null? You have it so its zero, but how do I make it null instead? Thanks.
 
Can you explain whether you need it to be null just so that it doesn't appear? Or do you need it to be null because of calculations that use some kind of count? If the former, just format the field by right clicking on it->format field->number->customize->suppress if zero.

-LB
 
Right. I basically do not want it to show. The supress should work. Thanks.
 
I am having one more problem converting a string to a number.

I have a formula that is...

ToNumber(numberstring).

It appears, that when I come to a string that is null, an error message tells me "string is non-numeric".

I tried the If statement to force the formula to 0 if its null, but that doesn't work either. It still tells me "string is non-numeric". Any ideas? Thanks.
 
Try:

if isnull({table.string}) or
trim({table.string}) = "" or
not isnumeric({table.string})then
0 else
val({table.string})

Val might work on its own, but the above should work for sure.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top