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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suppressing main report when blank

Status
Not open for further replies.

vman2

Programmer
May 9, 2002
3
GB
hi, (using crystal7) iv duplicated my sub report and pu a check nulls formular on it then a shared value forula on my main report to suppress any blank details section. but now the formula i use to subtract one date string from another in the sub report has stopped working.could this be because it is calculating the formula twise? code=

Local dateTimeVar ax := DateTime(val(Mid ({calllog.stoptime},1,4)),
val(Mid ({calllog.stoptime},5,2)),
val(Mid ({calllog.stoptime},7,2)),
val(Mid ({calllog.stoptime},9,2)),
val(Mid ({calllog.stoptime},11,2)),
val(Mid ({calllog.stoptime},13,2))
);

Local dateTimeVar bx := DateTime(val(Mid ({calllog.starttime},1,4)),
val(Mid ({calllog.starttime},5,2)),
val(Mid ({calllog.starttime},7,2)),
val(Mid ({calllog.starttime},9,2)),
val(Mid ({calllog.starttime},11,2)),
val(Mid ({calllog.starttime},13,2))
);

DateTimeToSeconds (ax) - DateTimeToSeconds (bx)

the error is "a day number must be between 1 and the number of days in the month" it worked ok before i added the duplicate report.

thanks
 
I doubt that is the problem.

My guess is that you are running into to a record that has an invalid days value - or is blank. Since it is stopping on the day (not the year or month) it is most likely an invalid days value.

One way to create test is to create a formula that takes out the day value alone, sort on this, and see if there are any values that are not betweeen 1 and 31. Of course even a 31 could be invalid in certain months. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top