I was using Hour(Fields!tempo.Value)
for get the hour from a field (tempo). The problem came when I got for first time "24:00" and the report shows the '#error'.
The description in 'Hour' function said:
Returns an Integer value from 0 through 23 representing the hour of the day
So, I changed the expression to
=IIf(Fields!tempo.Value = "24:00", 0, Hour(Fields!tempo.Value))
but yet I get the #error. Then I tried:
=IIf(Fields!tempo.Value = "24:00", 0, 1)
and correctly I get "0" for 24:00 values and "1" for the rest.
- I don't understand why
Hour()
won't work underIIf()
. - Maybe exist some better workaround for this case and I don't know it.
Thanks in advances
EDIT:
The idea is get all events which started between 2 hours every day (for filter events from the morning, afternoon and night):
=IIf(Hour(Fields!tempo.Value) >= 22 Or Hour(Fields!tempo.Value) <= 6, SHOWTHIS, Nothing)