Help !!!!!!!!!!!!!!!!

fatbloater

Registered User.
Local time
Today, 08:42
Joined
Sep 28, 2004
Messages
36
Attached is a copy of a database in the making, had to start again due to new requirements! On pressing stop i need vb code to look at start_time and finish_time and work out the on_peak and off_peak duration (using tbl_tables), that will let me work out the cost. Was thinking about doing if statements but got confused, would be very grateful for some help.
P.S. This db is for snooker tables not phone calls (just in case u get confused!)

Sorry, this should work now!
 

Attachments

Last edited:
fb,

Can't read your .ZIP attachment.

I like Pool Tables tho ...

Wayne
 
I can't unzip the file either, I get an error from Winzip saying it doesn't appear to be a valid zip file.

Can you upload the file again?
 
Can ANYBODY help?

I am getting desperate, can anybody help me with this problem?????
 
Still no joy, got it all working aprat from the code i need to look at the start time and the finish time and work out how much is off peak and how much is on peak - someone must have an insight, i have started to go grey!
 
Will have a look. One thing, how long do expect the duration to be? Mins, Hours, days?

Dave
 
I expect it to be hours, would be great if you could help.
 
The first (though I don't claim it's necessarily the best) method that springs to mind is to divide the day into 1440 minutes. Let us say that your peak hours are between 10am and 5 pm. This would divide your day into three sectors. Minute 1 to Minute 599 is off peak. Minute 600 to Minute 1020 is peak and Minute 1021 to Minute 1440 is off-peak again. You will need to convert the entered times into their minute equivalents and then use Select case or nested Iff statements to calculate how many minutes fall into each sector, using the start and end minutes as references. Convert the minutes back into your minimum charging units for each sector and the job is done. Post again if this method seems feasible to you and you would welcome further elucidation
 

Users who are viewing this thread

Back
Top Bottom