Hello Everyone,
I'm using Crystal Reports XI against a MSSQL 2000 database. I have a report that does a datediff between two date/time fields. Here is the formula:
datediff("s",{activity.new_date},{activity.working_date}); //get the seconds between 2 dates
Then its converted to Days:Hours:Minutes:Seconds using this formula:
numbervar days;
numberVar hrs;
numberVar min;
numberVar sec;
stringVar ddhhmmss;
days:= Truncate(Truncate(Truncate(Average ({@Daily Total Seconds}, {activity.activity_date}, "monthly")/60)/60)/24);
hrs := Remainder(Truncate(Truncate(Average ({@Daily Total Seconds}, {activity.activity_date}, "monthly")/60)/60),24);
min := Remainder(Truncate(Average ({@Daily Total Seconds}, {activity.activity_date}, "monthly")/60),60);
sec := Remainder(Average ({@Daily Total Seconds}, {activity.activity_date}, "monthly"),60);
ddhhmmss := totext(days,0,"") + ":" + totext(hrs,"00") + ":" + totext(min,"00") + ":" + totext(sec,"00");
ddhhmmss
I have the report grouped by a different date, printing monthly. I would like to summarize the Days:Hours:Minutes:Seconds by month at the end of the report. All I can figure out how to do is display this by seconds (using chart wizard). Do any of you have any suggestions. It certainly doesn't have to be a chart.
As always, thank you for the awesome advice and support.
____________________________________________________________
I'm using Crystal Reports XI against a MSSQL 2000 database. I have a report that does a datediff between two date/time fields. Here is the formula:
datediff("s",{activity.new_date},{activity.working_date}); //get the seconds between 2 dates
Then its converted to Days:Hours:Minutes:Seconds using this formula:
numbervar days;
numberVar hrs;
numberVar min;
numberVar sec;
stringVar ddhhmmss;
days:= Truncate(Truncate(Truncate(Average ({@Daily Total Seconds}, {activity.activity_date}, "monthly")/60)/60)/24);
hrs := Remainder(Truncate(Truncate(Average ({@Daily Total Seconds}, {activity.activity_date}, "monthly")/60)/60),24);
min := Remainder(Truncate(Average ({@Daily Total Seconds}, {activity.activity_date}, "monthly")/60),60);
sec := Remainder(Average ({@Daily Total Seconds}, {activity.activity_date}, "monthly"),60);
ddhhmmss := totext(days,0,"") + ":" + totext(hrs,"00") + ":" + totext(min,"00") + ":" + totext(sec,"00");
ddhhmmss
I have the report grouped by a different date, printing monthly. I would like to summarize the Days:Hours:Minutes:Seconds by month at the end of the report. All I can figure out how to do is display this by seconds (using chart wizard). Do any of you have any suggestions. It certainly doesn't have to be a chart.
As always, thank you for the awesome advice and support.
____________________________________________________________