Calculate time difference

Kalivati

New member
Local time
Today, 20:29
Joined
May 27, 2008
Messages
2
hi,
I have a form from a table with 4 fields namely Date Issued,Time Issued,Date Cleared & Time cleared. In a textbox I want the difference in time to be entered automatically after I fill all the 4 fields in the form.
I know a bit of VB 6.

could you please help me.

Thanking you in advance
Kalivati
 
you can add the date and time fields together then substract the two to find the difference.

Something like so:
(Date Cleared + Time cleared) - (Date Issued +Time Issued)

Good luck
 
Can you or anyone show the actual coding for me please.
This is what i started with.

Private Sub Command59_Click()
Dim datStart As Date
Dim datStop As Date
Dim txtDate As TextBox
Dim txtDateCleared As TextBox

txtDateIssued.Text = datStart
txtDateCleared.Text = datStop

OutageTime.Text = "Report took " & DateDiff(DateInterval.Second, datStart, datStop) & " seconds"

End Sub
 
Can you or anyone show the actual coding for me please.
which is what I allready did, more or less...

This is what i started with.

Private Sub Command59_Click()
Dim datStart As Date
Dim datStop As Date
Dim txtDate As TextBox
Dim txtDateCleared As TextBox

txtDateIssued.Text = datStart
txtDateCleared.Text = datStop

OutageTime.Text = "Report took " & DateDiff(DateInterval.Second, datStart, datStop) & " seconds"

End Sub
Something like so??
DateDiff(DateInterval.Second, (Date Cleared + Time cleared), (Date Issued +Time Issued))
 
I tried a variation of this, (at least I think its similar) only time involved no dates

=HoursandMinutes([time finished]-[time started])

it works fine in the form and calculates the elapsed time, no problems. It doesnt save the calculated values to the table however, saves them in the form but doesnt transfer them to the table. Is there a way to change this?
 

Users who are viewing this thread

Back
Top Bottom