Link to home
Start Free TrialLog in
Avatar of Judy Deo
Judy DeoFlag for United States of America

asked on

determining number of hours between two times

i have the following start date and end date variables in a form:
 
startdatemonth - (values are 1-12)
startdateday - (values are 1-31..depeding upon the month)
startdateyear - (values are 2004 - 2010)
starttimehour - (values are 6, 6.5, 7, 7.5, 8, 8.5, etc.)
starttimeamorpm - (values are am/pm)

ex. 3/26/2004 8.5 am

enddatemonth - (values are 1-12)
enddateday - (values are 1-31..depeding upon the month)
enddateyear - (values are 2004 - 2010)
endtimehour - (values are 6, 6.5, 7, 7.5, 8, 8.5, etc.)
endtimeamorpm - (values are am/pm)

ex. 3/26/2004 5 pm

i basically want to determine the number of hours in between these two dates.

so for above example it should be 8.5 hours (where 8.5 above means 8:30)

how to do this?

Avatar of Tacobell777
Tacobell777

You need to use dateDiff("h", yourdate1here, yourdate2here)
Avatar of Judy Deo

ASKER

but in what format should "yourdate1here" and  "yourdate2here" be? will it let me include the time part (i.e 7:30 am) ?
SOLUTION
Avatar of Tacobell777
Tacobell777

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks.
i forgot to ask one thing about the DateDiff function. i will ask it another question.