<% ' Show notifications that are either: ' 1. Have endtime >= NOW() (scheduled to end in future), OR ' 2. Have NULL endtime (indefinite - no end date set) strSQL = "SELECT * FROM notifications WHERE starttime <= NOW() + INTERVAL 10 day AND (endtime >= NOW() OR endtime IS NULL) AND isactive=1 ORDER BY starttime ASC" set rs = objconn.Execute(strSQL) IF NOT rs.eof THEN while not rs.eof %> <% rs.movenext wend ELSE %>
No Notifications
<% END IF %>