Hi,
I am having as issue, aren't we all :-)
I have created a events marquee listing using Classic ASP. Since the scripting looks at the date and posts only the data for that date and a few days after, I need to refresh the page every night around midnight so lets removes the previous days listings, for example, if the date is 12/12/12, any listing that had a date of 12/11/12 would not show.
I have searched the forum and did not find an answer specific to my question.
1) I am trying to refresh an IE browser window automatically after 12:00 AM
2) I know I can refresh the page at intervals (every 5 minutes, 3 hours, etc) but using this will not work. If I refresh the page at 9:00PM due to a reboot, this will throw off the time and old listings will be present.
3) I could refresh every few hours but I would rather not since this page will be in public view and I am unsure how it will look during the date. This is why I want a specific time when there will be no one looking at the listing.
Does anyone have any ideas?
Thanks a bunch. Happy Holidays!!
<%
sql="select * from myTable where fldDATE = "&date
%>
If your date field is ms sql datetime you need to normalize the date formate and get rid of the time like this.
<%
sql="select * from myTable where DATEADD(dd,0, DATEDIFF(dd,0,fldDATE)) = "&date
%>
Any time your page loads it will only use the current date's info.
If you are talking about keeping a browser open all the time as in a kiosk, you simply will use the same type of sql and use javascript to refresh the page. I would suggest this is not a great way to work unless the browser is open 24 hrs a day for a kiosk situation.
<script>
window.setInterval("checkF
function checkForRefresh() {
var now = new Date();
if (now.getHours() === 0 && now.getMinutes() === 1) {
window.refresh();
}
}
</script>