Hi all
I am trying to do a timetable view from a database list of events. The view works fine but for some (VERY) strange reason when I have anything at 11:30:00 AM (either the beginning of an event or end) it doesn't do the comparison correctly.
Below is a screen shot of what I mean:
The string in grey is the event name, ignore what is in the brackets, the number is a StrComp function on the EndTime and Current Time Block, the next one is the StartTime of the event (10:30:00 AM), the next time is the EndTime (11:30:00 AM) and lastly the last time shown is the current time block.
The comparison is shown below to see whether the information is displayed or not:
Then if
isn't 1 then a link is shown with 'Make Appointment'.
The problem is that when it comes to test whether the EndTime of the event is BEFORE the Current Time Block for events that End (OR Start for that matter) at 11:30:00 AM it reports that it ISN'T before the Current Time Block and ends up showing the data!! For every other event start and end time configuration this doesn't happen!! It is driving me nuts!
The StrComp binary test shows they are the same (showing 0 in the screen shot) so how on earth can the if one is less than the other return true?!?!?
I am trying to do a timetable view from a database list of events. The view works fine but for some (VERY) strange reason when I have anything at 11:30:00 AM (either the beginning of an event or end) it doesn't do the comparison correctly.
Below is a screen shot of what I mean:

The string in grey is the event name, ignore what is in the brackets, the number is a StrComp function on the EndTime and Current Time Block, the next one is the StartTime of the event (10:30:00 AM), the next time is the EndTime (11:30:00 AM) and lastly the last time shown is the current time block.
The comparison is shown below to see whether the information is displayed or not:
Code:
if cdate(rs_studenttimetable("Start")) =< cdate(tt_time) AND cdate(rs_studenttimetable("End")) > cdate(tt_time) then
response.write "<td class='srchres1' bgcolor='#cccccc'>" & rs_studenttimetable("Reference") & " (" & rs_studenttimetable("Period Reference") & ") " & StrComp(cdate(rs_studenttimetable("End")),tt_time) & " - " & cdate(rs_studenttimetable("Start")) & " - " & cdate(rs_studenttimetable("End")) & " - " & cdate(tt_time) & "</td>"
FoundALesson = 1
Exit Do
else
end if
Then if
Code:
FoundALesson
The problem is that when it comes to test whether the EndTime of the event is BEFORE the Current Time Block for events that End (OR Start for that matter) at 11:30:00 AM it reports that it ISN'T before the Current Time Block and ends up showing the data!! For every other event start and end time configuration this doesn't happen!! It is driving me nuts!
The StrComp binary test shows they are the same (showing 0 in the screen shot) so how on earth can the if one is less than the other return true?!?!?