473,405 Members | 2,141 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 time is calculated

198 100+
Hi
i am getting probleum in calculating time difference between two time values
e.g.
starttime =12:56:05 PM
endtime = 1:16:29 AM //wrong value
endtime=1:16:29 PM // correct value
but when i insert the value in endtime variable it converts PM Into AM
and i want the same value i,e endtime = 1:16:29 PM
starttime and endtime have date datatype and default value in these variables have "12:00:00"
please tell me the solution how can i solve this probleum

varinder
Jun 30 '08 #1
2 1025
QVeen72
1,445 Expert 1GB
Hi,

Try this :

Expand|Select|Wrap|Line Numbers
  1.     Dim StTime As Date
  2.     Dim ETime As Date
  3.     StTime = CDate("12:56:05 PM")
  4.     ETime = CDate("1:16:29 PM ")
  5.     MsgBox DateDiff("n", StTime, ETime)
  6.  
Regards
Veena
Jun 30 '08 #2
veer
198 100+
Thanks Very Much
it is working

best regards
varinder


Hi,

Try this :

Expand|Select|Wrap|Line Numbers
  1.     Dim StTime As Date
  2.     Dim ETime As Date
  3.     StTime = CDate("12:56:05 PM")
  4.     ETime = CDate("1:16:29 PM ")
  5.     MsgBox DateDiff("n", StTime, ETime)
  6.  
Regards
Veena
Jul 1 '08 #3

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

Similar topics

4
by: luscus | last post by:
I am trying to device a formula so that when i check of a yes/no box (done) it will automatically add the time in a field called "End Time" and at the same time stamp the amount of minutes...
3
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
1
by: bob.hughes | last post by:
I'm trying to write a query that will find multiple transactions that take place within a pre-determined time limit. I can easily compute the time between adjacent transactions and then judge...
3
by: Shaun Harwood | last post by:
Hello all I seem to be getting nowhere with this issue - I'm sure it is not that complex so here goes. I want to create a table with three fields - two date/time types (Start_Date & Stop_Date)...
3
by: Stephen Chaplin | last post by:
I'm summing up time spent on jobs over a week, some of these jobs last greater than 24 hours and when access sums these up it appears that it starts again at 00:00 once it gets past 23:59. Is it...
5
by: Henrik | last post by:
The problem is (using MS Access 2003) I am unable to retrieve long strings (255 chars) from calculated fields through a recordset. The data takes the trip in three phases: 1. A custom public...
33
by: desktop | last post by:
In the C++ standard sec 23.1.2 table 69 it says that erase(q) where q is a pointer to an element can be done in amortized constant time. I guess that is not worst case since std::set is...
3
by: tdes42 | last post by:
I believe I am looking for some form of Join Query, but my understanding of Access logic and my logic do not yet click entirely…. I have a table of ocean buoy data, taken every hour over many...
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...
5
by: trixxnixon | last post by:
in access 97, i have a value returned on a report in the format of hh:mm:ss, this is calculated by the query used as the control source for the report. i want to add an unbounded control to the...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.