-
subtraction of time
URGENT ::::::
I have a drop down box showing
0 minutes
5 minutes
10 minutes
1 hour
2 hours etc etc
i then have another drop down box with
00:00
00:30
01:00 etc etc
i want to be able to subtract the first amount of time from the second i know i will need a case statment on the first one saying something allong the lines of
select case me.blah.selectedValue
case 1 'remove 5 minutes from time
BLAH = my new time which should be 00:25
end select
what do i do to subtract time ive seen that datediff can handle time but when ever i try it buggers up
-
I'd use date diff. Post some code if you get an error and we'll try and sort it for you.
-
the code is pretty set up but heres all the info
i have a combo called StartTime and another one called reminder time
StartTime has values of every 30 minutes starting from 00:00 to 23:30
ReminderTime is like
0 Minutes
5 minutes
10 minutes
15 minutes
- rest skipped
1 hour
2 hours
- rest skipped
1 Day
2 day
etc
So i would do this
Dim dte_ReminderTime
Select Case Me.ReminderTime.SelectedIndex
Case 0 ' Subtract Nothing
Case 1 'Subtract five minutes
dte_ReminderTime = StartTime - 5 minutes (this is what im not sure of )
Case 2 'Subtract 10 minutes
End Select
-
it's dateadd you wanna use sorry.
Code:
Dim temp As Date
temp = DateAdd(DateInterval.Minute, -5, #9:00:00 AM#)
-