GET-IT: TEAMS DAY | 1-Day Free Virtual Conference all about Teams. Here on Petri.com - 8/12/20 GET-IT: TEAMS DAY - 8/12/20

ASP/VB Time comparison doing my nut!

Home Forums Scripting General Scripting ASP/VB Time comparison doing my nut!

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    tonyyeb
    Member
    #155154

    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:

    screenie.jpg

    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:

    if cdate(rs_studenttimetable(“Start”)) =< cdate(tt_time) AND cdate(rs_studenttimetable("End")) > cdate(tt_time) then
    response.write “

    ” & 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) & “


    FoundALesson = 1
    Exit Do
    else

    end if
    [/CODE]

    Then if [CODE]FoundALesson[/CODE] 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?!?!?[CODE]
    if cdate(rs_studenttimetable(“Start”)) =< cdate(tt_time) AND cdate(rs_studenttimetable("End")) > cdate(tt_time) then
    response.write “

    ” & 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) & “


    FoundALesson = 1
    Exit Do
    else

    end if
    [/CODE]

    Then if FoundALesson[/CODE] 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?!?!?[CODE]FoundALesson[/CODE] 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?!?!?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.