Hello
I have two datetimepicker controls one as a start date the other as end date,
How do I go about subtracting the values to ge the number of hours?
I tried...
Private Sub CalculateHours()
Dim TotalHours As Integer
Dim StartDate As Date
Dim FinishDate As Date
StartDate = DateTimePicker1.Value
FinishDate = DateTimePicker2.Value
TotalHours = 24 * (FinishDate - StartDate) ' error here
End Sub
...but I get the error "Operator '*' is not defined fpr types integer and System.timespan"
Do I need to do some casting?
thanks Steve
I have two datetimepicker controls one as a start date the other as end date,
How do I go about subtracting the values to ge the number of hours?
I tried...
Private Sub CalculateHours()
Dim TotalHours As Integer
Dim StartDate As Date
Dim FinishDate As Date
StartDate = DateTimePicker1.Value
FinishDate = DateTimePicker2.Value
TotalHours = 24 * (FinishDate - StartDate) ' error here
End Sub
...but I get the error "Operator '*' is not defined fpr types integer and System.timespan"
Do I need to do some casting?
thanks Steve