Jul 1, 2003 #1 Raid5 IS-IT--Management Oct 16, 2002 36 US How would I add up calculated times. EX. 1:45 3:30 I get the number 2 in my report I am expecting 5:15. Can Crystal even add up times?
How would I add up calculated times. EX. 1:45 3:30 I get the number 2 in my report I am expecting 5:15. Can Crystal even add up times?
Jul 1, 2003 #2 synapsevampire Programmer Mar 23, 2002 20,180 US Is this what it looks like in the database, just a time field with no date? And how do you want to display 23:45 + 22:45? Should it have an additional days column, or show 56:30? You can accumulate the times using a formula in the details (or wherever) using a formula such as: whileprintingrecords; numbervar Hours := Hours+val(left("01:45",instr("01:45",":"-1)); numbervar Minutes := Minutes + val( mid("01:45",instr("01:45",":"+1,2)); If this is within a group, then first set the values to 0 in the group header: whileprintingrecords; numbervar Hours := 0; numbervar Minutes := 0; Then in the Group Header (or report footer if there isn't a group) use the following in a formula to display it: whileprintingrecords; numbervar Hours; numbervar Minutes; Minutes := remainder(Minutes,60); Hours := Hours + truncate(remainder(Minutes,60)); totext(Hours,0,""+":"+totext(minutes,0,"" -k Upvote 0 Downvote
Is this what it looks like in the database, just a time field with no date? And how do you want to display 23:45 + 22:45? Should it have an additional days column, or show 56:30? You can accumulate the times using a formula in the details (or wherever) using a formula such as: whileprintingrecords; numbervar Hours := Hours+val(left("01:45",instr("01:45",":"-1)); numbervar Minutes := Minutes + val( mid("01:45",instr("01:45",":"+1,2)); If this is within a group, then first set the values to 0 in the group header: whileprintingrecords; numbervar Hours := 0; numbervar Minutes := 0; Then in the Group Header (or report footer if there isn't a group) use the following in a formula to display it: whileprintingrecords; numbervar Hours; numbervar Minutes; Minutes := remainder(Minutes,60); Hours := Hours + truncate(remainder(Minutes,60)); totext(Hours,0,""+":"+totext(minutes,0,"" -k