473,471 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Time differnce in whole hours

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
1 2430
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Monty | last post by:
Let's say you provide an online service from 7:00AM to 6:00PM Eastern Time (daylight time in the summer). Is there way of showing these hours of availability on a web page in the user's local...
2
by: CDF | last post by:
In one of my tables, I have a field that has time durations in it. The field is currently in text format. Is there a way that I can convert this field into a format where I can SUM the durations? ...
4
by: M. Uppal | last post by:
How do i convert fraction to time in c#. I need to convert 0.25 to time. Excel does this by using Selection.NumberFormat = "h:mm:ss;@" of the Cell Format function. thanks, M. Uppal
7
by: Brett Edman | last post by:
I created a UTC clock using this: UTCTime = MyTime.ToUniversalTime() Now that we've turned the clocks ahead 1 hour for daylight savings time, the clock is reporting the wrong UTC time. It is...
3
by: Shawn Yates | last post by:
I have a database that I am using as a Time clock where employees can clock in and out. Is there a way to make it so that when they clock out a form would open displaying their work day hour by...
2
by: No bother | last post by:
I have a table such as below: BreakID StartTime EndTime 1 08:00:00 10:00:00 2 08:00:00 10:30:00 3 08:00:00 11:00:00 4 08:30:00 11:00:00 What I need to find are the whole clock hours...
2
by: ZR | last post by:
Hello, I need to convert a GMT time string to local time. I can fill out a "tm" structure with the GMT time string. Are there any standard C (or OS) time functions that will allow me to do this? ...
2
by: dwasbig9 | last post by:
Hi Group (fairly limited knowledge of Access and almost none of Access VBA. Using Access 2003). I need to sum time, I've found through the groups archive an sql extract that led me to this ...
5
by: msmydream | last post by:
I have a doubt... What all are the key differnce between visual studio express edition and the actul visual studio licenced version? The key feature differnce is what i am interested
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.