473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to get the Difference Between Two Time Fields?

pravipravi
Actually i am using two time values.But they are created as Date and time format.Keeping that format i want to find the Time deffrence between InTime and OutTime.As do the job normally i got a 0.30658874 as answer.How can i make the diffrence?That is Outtime-InTime form tblHistory?
Feb 24 '07 #1
3 2689
MMcCarthy
14,534 Expert Mod 8TB
Actually i am using two time values.But they are created as Date and time format.Keeping that format i want to find the Time deffrence between InTime and OutTime.As do the job normally i got a 0.30658874 as answer.How can i make the diffrence?That is Outtime-InTime form tblHistory?
Expand|Select|Wrap|Line Numbers
  1. TimeSerial(0,DateDiff("n",[InTime],[OutTime]),0)
Try this.

Mary
Feb 24 '07 #2
MSeda
159 Expert 100+
multiply by 24. Even though the format only shows time it's still calculated as time and date.
Feb 25 '07 #3
NeoPa
32,556 Expert Mod 16PB
As MSeda says, the result you got is actually quite correct and refers to a fractional portion of a day. To get the days from this use :
Expand|Select|Wrap|Line Numbers
  1. Format(OutTime - InTime, "0")
To get the fractional portion use :
Expand|Select|Wrap|Line Numbers
  1. Format(OutTime - InTime, "HH:nn:ss")
Feb 26 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Eric J.Hu | last post by:
Hi, Such as I have following bitmap structure and assigned value: struct bm { char high2bits:2; char mid4bits:4; char low2bits:2; }; bm.high2bits = 3;
6
by: Bjørn T Johansen | last post by:
I need to compute the difference of Time fields, in the format HHMM. Is it possible to do the math in the Select? Regards, BTJ --...
1
by: mark | last post by:
I'm stuck: In a query I am trying to compare two fields with a date/time data type and a LongTime format to get the difference in hours (minutes and seconds if possible). After that I need to...
2
by: Amit | last post by:
Hello, I have a class where I store a lot of setting names. Right now they're all declared as consts : public const CurDoc as string = "CURRENT_DOCUMENT" From what I know about const, every...
4
by: Yotam | last post by:
Hi, I need some help with JS. I will be grateful, if you can help me out. I have two date fields (check in, check out) and "number of days" field. I want the script to calculate automatically...
9
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a difference between MSDE and SQL Express 2005 (I'll just...
3
by: bbawa1 | last post by:
Hi, I have a table which has a field ItemsReceived of type datetime. I have a grid view which has two columns. In first column i have to show the data from field ItemsReceived and in second...
3
by: Steve | last post by:
I am trying to calculate elapsed travel times for flights. My plan is to enter the local departure time, the departure city and the local arrival time and city. These times would be standardised...
15
by: student4lifer | last post by:
Hello, I have 2 time fields dynamically generated in format "m/d/y H:m". Could someone show me a good function to calculate the time interval difference in minutes? I played with strtotime() but...
4
by: Quizzed | last post by:
Hi, Using MS Access 97, i have a query over an As/400 which returns a number of fields. Within each record returned, two fields are of numeric data type but contain values relating to time. The...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.