473,387 Members | 1,721 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,387 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 2686
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.