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

Home Posts Topics Members FAQ

Help - Hours intervals problem

Hi,

I'm struggling with the following problem and after days I feel it's
time to seek help.

I have 2 datetime (time) variables:

Dim BeginHour As DateTime
Dim EndHour As DateTime

Dim Period1, Period2, Period3 As String

I have these periods:

00:00 to 07:00 'night
07:00 to 19:00 'day
19:00 to 24:00 'evening

I have to calculate:
1)How many periods in the preceding list BeginHour and EndHour cover.
2)Associate different strings to each period covered:

Example:
BeginHour = "23:00:00"
EndHour = "01:00:00"

In that case:
Period1 = "evening"
Period2 = "night"
Period3 = ""

But it's really with the following that I have problems:

BeginHour = "01:00:00"
EndHour = "23:00:00"

In that case, result should be:
Period1 = "night"
Period2 = "day"
Period3 = "evening"

I can't figure out how to do it and this is where I need your help.

Thanks,

ML

Sep 15 '06 #1
0 879

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

Similar topics

1
by: Marcus | last post by:
Hi all, sorry to post yet another unix timestamp question, but I've been looking through php.net and google and can't find exactly what i need... plus I think my brain has shut down from too many...
1
by: MattMika | last post by:
I am trying to integrate a Credit Card # deletion option into Batch_print_center and need some help. Batch_print_center has a form where you specify orders you want to print or proccess by...
4
by: Hans | last post by:
Hi there, I need to create a list (diary style) of times in a day. I can do this with normal "metricated" break-up of the hours, but need to display the actual time. I have a "Starting time" and...
0
by: Brady Orand | last post by:
I have a table with the following description: user varchar(64) outtime datetime intime datetime <other irrelevant columns> I want to query this table from datetime1 to datetime2 at...
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...
6
by: D | last post by:
Hello all...I have an issue with one of my java script functions that I'm hoping someone can easily help with. I have a web based application that we use to create/sign up for overtime. When we...
10
by: CuTe_Engineer | last post by:
hii, i have cs assignment i tried to solve it but i still have many errors , plzz help mee :"< it`s not cheating becuz i`ve tried & wrote the prog. i just wanna you to show me my mistakes ...
4
by: brazil.mg.marcus.vinicius.lima | last post by:
Hello, I need to create a column that will store hours bigger than 24. For example '25:00:00', '129:23:12', etc). That column will be used too, for perform calculations between datetime...
10
by: pyotr | last post by:
Simply my problem is: I need to validate the StartDate and EndDate when entered for an employee through subform. the purpose is to avoid entering a date that violate or overlap date intervalS that...
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...
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,...
1
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...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.