Formating issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using 04/03/04, 23:00 and 04/04/04, 23:00 as the dates. How would I get this to read in hours, I tried setting the field format to short but then I get 0:00. The format that I have used on the date fields is: mm/dd/yy", "hh:n

Dim strdate As Dat
Dim enddate As Dat

strdate = Me.out_startdate_time_tx
enddate = Me.out_findate_time_tx

Me.out_duration_txt = (enddate - startdate) * 24
 
Hi Derek,

Use the DateDiff() function, something like

Me.out_duration_text = DateDiff("h", strdate, enddate)

Using 04/03/04, 23:00 and 04/04/04, 23:00 as the dates.
How would I get this to read in hours, I tried setting the field format
to short but then I get 0:00. The format that I have used on the date
fields is: mm/dd/yy", "hh:nn
 
Back
Top