Link to home
Start Free TrialLog in
Avatar of John-S Pretorius
John-S PretoriusFlag for United States of America

asked on

Calculating multiple durations

I have a previous solution (Question) that needs some further fine tuning. Current data is sorted under room numbers and may have more than one transaction within a day or after registration. : Please see Image or Report data included. The issue I'm currently running into is if there is more than one transaction I only calculate the duration from the last transaction which would be less revenue than if I use the Total duration while someone is actually present.


 User generated image PARC-Report-.pdf PARC-Report-.rpt parc.txt
Avatar of Mike McCracken
Mike McCracken

What duration do you want to calculate?

WHat constitutes the start and end of the duration cycle?

What about multiple entries and exits in a day?

Are you only counting time when the car was in the lot?

mlmcc
Avatar of John-S Pretorius

ASKER

I'm trying to calculate only the duration when the vehicle is parked inside the garage.

Single entries I'm not worried about, multiple entries causes wrong totals as currently I'm using the last transaction.

Typically if someone is parked for longer than a day I use midnight and end of day but if the user is parked from registration that becomes the starting point.

I'm really only interested in up to7 hrs as that would-be the max day rate that can be charged, I'm trying to be more accurate with the duration as should some only have a last entry of an hour I currently will calculating $2, which is wrong if he had multiple transactions see example.
So an in at 9PM get 3 hour charge for the day since it didn't leave

WHen he leaves at 9AM he gets a 9hr charge on the next day. Any concern about overcharge since the total duration was over 7 hours?

In 3pm, out 6pm, in 10pm 5 hours

mlmcc
For single transaction I have it doing exactly that : in at 9pm will calculate his duration as 3Hrs parked until midnight and should he leave at 9am he was parked for 9 Hrs. (This is the easy part for single transactions) - I also have to look out for single day transaction that actually registered on the same day vs the previous day if it's on the same dat duration would be from registration but if it's from a previous day it its from midnight.

I am more interested in the total duration if the count (of that groups > 1) so if there was 5 transactions (IN, OUTIN, OUT...) up to 7 hours, after 7 Hrs I don't care because that will be the max rate. I am trying to be more accurate in the duration captured for users actually parked inside. for a day.

I am currently also working on another question exporting each days report to SQL so that I can then later create a accumilative report that will tell me the charges for each user for previous days is he was been parked on the prvious day.

Unfortuanatly I can only use RAW data / day and cannot get this previous day day from the original database due to 'something weird' which I'm not sure will be rectified hence the work-around.
I still have no solution
Are you still looking for a solution?

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of John-S Pretorius
John-S Pretorius
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.