Elapsed Hours and Minutes

MadAtMicrosoft

Registered User.
Local time
Today, 15:30
Joined
Sep 27, 2010
Messages
18
Hello again from a Newbie trying to "survive" long enough to be a novice.

I have a db for Equipment rentals where in Rental Rates are based first upon Days then partial days are billed based upon hours and minutes.

**************************************************
I have created the following tables:

A) tblRentalEqpt
B) tblCustomers
C) tblRentalsDetail
D) tblRentalRates

**************************************************

I've created a form where an Employee upon rental will select an Existing Customer or input if new the Customer, Select the Piece(s) Rented of RentalEqpt items which will behind the scenes create a record with the DateAndTime (General Date) that a piece of Eqpt is rented.

Then, upon the Customer's return, I created a form that will execute a select Query to pull all "Open" Rentals by the selected customer. That Temporary Select Query will populate a "RentalReturns" form where I have Comboboxes to Select the Customer and the OpenRental with a textbox to capture the original DateAndTimeStamp of when the rental occurred. The form also has a textbox that defaults to =Now() {General Date}

I have created unbound textboxes on the form that I am trying to populate with the following datediff's

=DateDiff("d",[cboRentalInDateAndTimeSelection],[txtRentalOutDateTimeStamp])

=DateDiff("h",[cboRentalInDateAndTimeSelection],[txtRentalOutDateTimeStamp])

=DateDiff("m",[cboRentalInDateAndTimeSelection],[txtRentalOutDateTimeStamp])


Days
Hours
Minutes

or Days and then Hours:Minutes (if that is possible)

I can't get it to return any correct # of Days or hours.

Any suggestions.
 
Here is a sample database that may help you.

You will need to modify the code to suit your field names etc.
 

Attachments

Poppa Smurf

Thank you! I modified it for my purposes.
 

Users who are viewing this thread

Back
Top Bottom