Cumulative Dive Data - Designer

Discussions about Diving Log 6.0 - questions and hints
Post Reply
sar1981
Posts: 9
Joined: Sun Mar 30, 2014 11:50

Cumulative Dive Data - Designer

Post by sar1981 »

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
sar1981
Posts: 9
Joined: Sun Mar 30, 2014 11:50

Re: Cumulative Dive Data - Designer

Post by sar1981 »

Any formula gurus around? :(
divinglog
Site Admin
Posts: 5777
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Cumulative Dive Data - Designer

Post by divinglog »

Hi Scott

This formula should convert minutes to minutes:hours:

Code: Select all

Fstr$(Floor(StatsDivetimeAll / 60),"?&") + ":" + Fstr$(StatsDivetimeAll - (Floor(StatsDivetimeAll / 60) * 60),"?&")
You can replace "StatsDivetimeAll" with any other minute variable you have. This formula is from the statistics report file.

Sven
sar1981
Posts: 9
Joined: Sun Mar 30, 2014 11:50

Re: Cumulative Dive Data - Designer

Post by sar1981 »

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
divinglog
Site Admin
Posts: 5777
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Cumulative Dive Data - Designer

Post by divinglog »

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
sar1981
Posts: 9
Joined: Sun Mar 30, 2014 11:50

Re: Cumulative Dive Data - Designer

Post by sar1981 »

sure thanks Sven
divinglog
Site Admin
Posts: 5777
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Cumulative Dive Data - Designer

Post by divinglog »

Hi Scott

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),"&&")
Kind regards,
Sven
sar1981
Posts: 9
Joined: Sun Mar 30, 2014 11:50

Re: Cumulative Dive Data - Designer

Post by sar1981 »

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
divinglog
Site Admin
Posts: 5777
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Cumulative Dive Data - Designer

Post by divinglog »

Hi Scott, I've updated the formulas above and now it should contain the leading zero.
sar1981
Posts: 9
Joined: Sun Mar 30, 2014 11:50

Re: Cumulative Dive Data - Designer

Post by sar1981 »

Perfect Sven, thank you very much!
divedude
Posts: 13
Joined: Sun Jan 04, 2009 23:03

Re: Cumulative Dive Data - Designer

Post by divedude »

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.
divinglog
Site Admin
Posts: 5777
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Cumulative Dive Data - Designer

Post by divinglog »

You probably deleted the dive time sum variable @sum01 (menu Project > Sum Variables).
divedude
Posts: 13
Joined: Sun Jan 04, 2009 23:03

Re: Cumulative Dive Data - Designer

Post by divedude »

divinglog wrote:You probably deleted the dive time sum variable @sum01 (menu Project > Sum Variables).
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
Site Admin
Posts: 5777
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Cumulative Dive Data - Designer

Post by divinglog »

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".
divedude
Posts: 13
Joined: Sun Jan 04, 2009 23:03

Re: Cumulative Dive Data - Designer

Post by divedude »

Thanks, that fixed it.
Post Reply