Don't you mean the Watch window?
Does it make sense that "success" would be printed here?
Sub Main()
Dim advenddate As Date, advstartdate As Date
advenddate = Date.Now
advstartdate = advenddate.AddHours(-2)
If Hour(advenddate) > Hour(advstartdate) Then
Debug.WriteLine("success")
End If
End Sub
Then put "Hour(advenddate) > Hour(advstartdate)" in the watch window, and
see if it says True.
"simon" wrote:
I have IF statement:
If Hour(advEndDate) >Hour(advStartDate) Then
state=0
else
state=1
End If
Anyway, if hour of end date is greater than the hour of start date, I have state=0.
If statement is always true.
If I write in command window:
Hour(advEndDate) >Hour(advStartDate)
I get FALSE as the result.
Why?
Thank you,
Simon