Cumulative Dive Data - Designer
Cumulative Dive Data - Designer
Hi guys,
I've spent a couple of hours on this but can't seem to get the right formula.
I have in my report;
Previous Total = 60min
This Dive = 30min
Cumulative Total = 90min
How do I change them all to hours:minutes format e.g. "1:30 hrs" ?
My current formulas for each;
"Previous Total: "+ Fstr$((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01+ LogDivetime)-LogDivetime,"#####&") + "min"
"This Dive: " +Fstr$(LogDivetime,"###&")+"min"
"Cumulative Total: "
+ Fstr$(StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01+ LogDivetime,"#####&") + "min"
I have messed around with the following formula (which works for Cumulative Total but can't get the right syntax for the other two it seems..)
"Cumulative Total: " +
Fstr$(Int((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01+ LogDivetime)/60),"###& hours") +
Fstr$((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01+ LogDivetime)%60," #& minutes")
Cheers
Scott
I've spent a couple of hours on this but can't seem to get the right formula.
I have in my report;
Previous Total = 60min
This Dive = 30min
Cumulative Total = 90min
How do I change them all to hours:minutes format e.g. "1:30 hrs" ?
My current formulas for each;
"Previous Total: "+ Fstr$((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01+ LogDivetime)-LogDivetime,"#####&") + "min"
"This Dive: " +Fstr$(LogDivetime,"###&")+"min"
"Cumulative Total: "
+ Fstr$(StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01+ LogDivetime,"#####&") + "min"
I have messed around with the following formula (which works for Cumulative Total but can't get the right syntax for the other two it seems..)
"Cumulative Total: " +
Fstr$(Int((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01+ LogDivetime)/60),"###& hours") +
Fstr$((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01+ LogDivetime)%60," #& minutes")
Cheers
Scott
Re: Cumulative Dive Data - Designer
Any formula gurus around?
Re: Cumulative Dive Data - Designer
Hi Scott
This formula should convert minutes to minutes:hours:
You can replace "StatsDivetimeAll" with any other minute variable you have. This formula is from the statistics report file.
Sven
This formula should convert minutes to minutes:hours:
Code: Select all
Fstr$(Floor(StatsDivetimeAll / 60),"?&") + ":" + Fstr$(StatsDivetimeAll - (Floor(StatsDivetimeAll / 60) * 60),"?&")
Sven
Re: Cumulative Dive Data - Designer
Thanks Sven,
I've tried various methods to get this formula to do what I need, I think lack of understanding is contributing.
My Original formulas work, but they display in Minutes (1230 min) rather than 20:30.
When I try using the formulas you gave me, i can't get it to work under all conditions. i.e. when I preview a print from 1-42 dives (my entire logbook) it displays differently than when I print only the last 10 dives.
+LogDiveTime field is fine, this can stay in Minutes, so I'm not worried about changing the format.
The fields I am having trouble with are;
Previous Dive Time = Total dive time up to the previous dive. I've tried using ToSel-LogDiveTime however if I'm printing all dives, this figure is obviously the total dive time from the last dive minus the LogDiveTime of the record I'm looking at.
Total Dive time = Total dive time up to and including the current dive, again it seems that it changes depending on which record I'm looking at.
I feel i'm not making sense and my explanation could be better but that's all I've got for now.
Cheers
Scott
I've tried various methods to get this formula to do what I need, I think lack of understanding is contributing.
My Original formulas work, but they display in Minutes (1230 min) rather than 20:30.
When I try using the formulas you gave me, i can't get it to work under all conditions. i.e. when I preview a print from 1-42 dives (my entire logbook) it displays differently than when I print only the last 10 dives.
+LogDiveTime field is fine, this can stay in Minutes, so I'm not worried about changing the format.
The fields I am having trouble with are;
Previous Dive Time = Total dive time up to the previous dive. I've tried using ToSel-LogDiveTime however if I'm printing all dives, this figure is obviously the total dive time from the last dive minus the LogDiveTime of the record I'm looking at.
Total Dive time = Total dive time up to and including the current dive, again it seems that it changes depending on which record I'm looking at.
I feel i'm not making sense and my explanation could be better but that's all I've got for now.
Cheers
Scott
Re: Cumulative Dive Data - Designer
Hi Scott
It's indeed a bit difficult to understand. Can you send me to info (at) divinglog.de your report file where you have the correct minute output and the only thing missing is the conversion to hh:mm?
Kind regards,
Sven
It's indeed a bit difficult to understand. Can you send me to info (at) divinglog.de your report file where you have the correct minute output and the only thing missing is the conversion to hh:mm?
Kind regards,
Sven
Re: Cumulative Dive Data - Designer
sure thanks Sven
Re: Cumulative Dive Data - Designer
Hi Scott
I think these are the 2 formulas you're looking for:
Kind regards,
Sven
I think these are the 2 formulas you're looking for:
Code: Select all
"Previous Total: "+ Fstr$(Floor((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01) / 60),"?&") + ":" + Fstr$((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01) - (Floor((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01) / 60) * 60),"&&")
Code: Select all
"Cumulative Total: "+ Fstr$(Floor((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01 + LogDivetime) / 60),"?&") + ":" + Fstr$((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01 + LogDivetime) - (Floor((StatsDivetimeToSel - StatsDivetimeBtSel + @Sum01 + LogDivetime) / 60) * 60),"&&")
Sven
Re: Cumulative Dive Data - Designer
Hi Sven,
I got your email, thank you very much.
These fields fix the problem nearly perfectly!
As per my email, is there anyway to get the leading Zero of the minute field to display?
Currently displays 11:8 but it would be nice to display 11:08
Only if it's easy... It is not important if not, this new formula is excellent
Cheers
Scott
I got your email, thank you very much.
These fields fix the problem nearly perfectly!
As per my email, is there anyway to get the leading Zero of the minute field to display?
Currently displays 11:8 but it would be nice to display 11:08
Only if it's easy... It is not important if not, this new formula is excellent
Cheers
Scott
Re: Cumulative Dive Data - Designer
Hi Scott, I've updated the formulas above and now it should contain the leading zero.
Re: Cumulative Dive Data - Designer
Perfect Sven, thank you very much!
Re: Cumulative Dive Data - Designer
I'm trying to set up my printed log report to show cumulative dive time, and I've tried the formulas on this page. The best result I get shows a time in hours and minutes, but it's the same time for all pages, it doesn't update with each dive.
Another result I get is using one of the other formulas, I get and error telling me that "@sum01" is unrecognized.
I have recently updated the layout of my report, only the layout, and previously it did correctly show total dive time (using the formulas you have on this page) but it no longer correctly updates.
Another result I get is using one of the other formulas, I get and error telling me that "@sum01" is unrecognized.
I have recently updated the layout of my report, only the layout, and previously it did correctly show total dive time (using the formulas you have on this page) but it no longer correctly updates.
Re: Cumulative Dive Data - Designer
You probably deleted the dive time sum variable @sum01 (menu Project > Sum Variables).
Re: Cumulative Dive Data - Designer
Thank you, I don't know when I would have deleted it, but if so can I get it back, or manually add it?divinglog wrote:You probably deleted the dive time sum variable @sum01 (menu Project > Sum Variables).
Re: Cumulative Dive Data - Designer
Sure, just go in the report designer into the menu "Project > Sum Variables" and create a new sum variable named "@sum01" based on the field "LogDivetime".
Re: Cumulative Dive Data - Designer
Thanks, that fixed it.