By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,773 Members | 2,307 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,773 IT Pros & Developers. It's quick & easy.

Time differnce in whole hours

P: n/a
Hi,

I am trying to compare two time fields to get the difference in hours
as a whole number. I have tried the following:

Format((Format('<ENDTIME>','hh.nn') -
Format('<STARTTIME>','hh.nn'))),'hh.nn')

The result I get is an int eg 2.20. What I want is a whole number
which just gives me the difference in hours, rounded up the next hour.
(in this case 3). In other words if the result is 2.00 then I want a 2
and if the result is greater than 2.00 (2.20 for example) then I want
3.

Can anyone help please?

Cheers.
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Consigliare" <as******@cs.man.ac.uk> wrote in message
news:9f*************************@posting.google.co m...
Hi,

I am trying to compare two time fields to get the difference in hours
as a whole number. I have tried the following:

Format((Format('<ENDTIME>','hh.nn') -
Format('<STARTTIME>','hh.nn'))),'hh.nn')

The result I get is an int eg 2.20. What I want is a whole number
which just gives me the difference in hours, rounded up the next hour.
(in this case 3). In other words if the result is 2.00 then I want a 2
and if the result is greater than 2.00 (2.20 for example) then I want


Check the help file for the DateDiff() function. (it works for time too).
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.