473,396 Members | 1,968 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,396 software developers and data experts.

time calculations


Hi

How do I add 1:45 to 1:45 to get 3:00

Regards
Dillon Mantle
Jul 17 '05 #1
3 11122
> How do I add 1:45 to 1:45 to get 3:00

You can't... those two times add to 3:30, not 3:00.<g>

As long as the total won't go over 24 hours,

Time1 = "1:45"
Time2 = "1:45"
Msgbox Format(CDbl(CDate(Time1) + CDate(Time2)), "h:mm")

Rick - MVP
Jul 17 '05 #2
"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:UP********************@comcast.com...
How do I add 1:45 to 1:45 to get 3:00
You can't... those two times add to 3:30, not 3:00.<g>


Well, to be truthful, you *can*... :) Just use your code, but add and If
statement to look and see if Time1 and Time2 equals "1:45" then set the
final answer to "3:00". Viola! He didn't ask how to make it correctly add
the times together, just to make those two times come out to 3:00. You
gotta go by command specs and do what they say. Never assume anything. Do
exactly what they say *or* ask first, then code it. :-D
As long as the total won't go over 24 hours,
Time1 = "1:45"
Time2 = "1:45"
if Time1 = "1:45" and Time2 = "1:45" then ' Those sneaky design specs.
MsgBox "3:00" ' Why would they want this value from those?
else
Msgbox Format(CDbl(CDate(Time1) + CDate(Time2)), "h:mm")
end if
Rick - MVP


Ken
un*****@hotmail.nospam.comc

Jul 17 '05 #3
t = #1:45:00 AM#
t = DateAdd("h", 1, t)
t = DateAdd("n", 45, t)
Answer= 3:30

"Dillon Mantle" <di*****@dasolutions.co.za> wrote in message
news:H_********************@is.co.za...

Hi

How do I add 1:45 to 1:45 to get 3:00

Regards
Dillon Mantle

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: kpp9c | last post by:
I am kind of in a bit of a jam (okay a big jam) and i was hoping that someone here could give me a quick hand. I had a few pages of time calculations to do. So, i just started in on them typing...
2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
11
by: lduperval | last post by:
Hi, I`m trying to do date calculations in three types of time zones: local, GMT and specified. The issue I am facing is that I need to be able to specify a date in the proper time zone, and I`m...
5
by: iminal | last post by:
I am trying to make a very simple program and am very new to the whole programming thing. my program is supposed to ask a user for any time in the for format XX:XX:XX and then ask for a time...
10
by: Marc Pelletier | last post by:
Hello, I am writing an application that does some simple astronomical calculations. One of the variables I need is the number of hours passed in this year. I've written the following function ...
5
by: cvisal | last post by:
Hi all Im working on productivity calculations (Time calculations) and need some help in coding. Database Tool:MS-Access 2003. The general operator punch-in time is 5:30 AM and the punch-out...
4
by: Steve | last post by:
Hi All I need to compare date times from 2 different states in Australia in a Program I have which determines which way to update SQl server 2005 tables based on the lastupdate (datetime field)...
16
by: shreyansghia | last post by:
Hello, I am a new member and am glad to a part of this forum. I am facing a slight problem while doing time calculations in MS access. I ve prepared a time sheet for my workers. Their regular...
18
by: Dirk Hagemann | last post by:
Hello, From a zone-file of a Microsoft Active Directory integrated DNS server I get the date/time of the dynamic update entries in a format, which is as far as I know the hours since january 1st...
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...
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: 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...
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
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
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...

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.