Basic Database suggestion

Antinora

New member
Local time
Today, 05:33
Joined
Aug 27, 2015
Messages
5
Greetings:

I need an order form type suggestion. I created a Form with a ComboBox drop down which populates Staff LN, FN, ID#, & shift (either early or late).

I'd like to put an input box on the Form which I can enter the time a staff member left early and then calculates time to delete from their payroll based on early or late shift.

The box would be on the form, I'd enter the time the staff left e.g. 2pm then calculates time difference between 2pm & if person is late shift (2:49 exit time) put 49 minutes in another box.

Please let me know if you need any other info. For known I'll keep on my search.

John
 
Presuming you have or can determine the actual date & time of departure and the expected date/time, and were only worried about minutes, you could look up the DATEDIFF function and use the units option that gives you the difference between the two date/time values in minutes. Note this works if and only if BOTH of the inputs are in date format and have dates as well as times associated with them AND the times need to be explicitly AM or PM, OR they need to be military times 00:00 to 23:59 on the same date. If the times are not on the same date, you MUST explicit dates for both inputs.

Note also that if your date/time data is actually a string representation of a date/time, you need to convert it before using the DATEDIFF function. Look up CDate as a way to convert date/time strings.
 

Users who are viewing this thread

Back
Top Bottom