Count the midday between two date

nilses

Registered User.
Local time
Today, 17:02
Joined
Jan 2, 2003
Messages
45
Hello,

I need you because I do not find the solution.

I would like to count the number of midday between two dates. I have a date of beginning and a date of end. For me the midday is 13:00:00/14:00:00 Here a example of what i want.

(year/month/day)
DateStart---------------------DateEnd--------------Number
03/03/10 10:00:00------03/03/10 16:00:00-------1
03/03/10 16:00:00------03/04/10 16:00:00-------1
03/03/10 10:00:00------03/04/10 16:00:00-------2
03/03/10 16:00:00------03/04/10 11:00:00-------1

Is it possible to make it?.

Your help will be appreciated.

Nilses
 
dim intMidDays as integer

intMidDays = DateEnd - DateStart

IF (DateStart > 14:00) AND (DateEnd < 13:00) THEN
intMidDays = intMidDays - 1
ElseIf
(DateStart < 14:00) AND (DateEnd > 13:00) THEN
intMidDays = intMidDays + 1
End If
 
Thanks for you help jkokkelmans.

I will try your advice

Nilses
 

Users who are viewing this thread

Back
Top Bottom