...of the week

Results 1 to 3 of 3

Thread: ...of the week

  1. #1
    perkale Guest

    Default ...of the week

    Here&#039s something I have been thinking about for a while: Is there a way of displaying one recordset from a table per week? It has to be dynamic in the sense that if new records are added they should be shown as well... there would be no more than 20 of them. Perhaps the recordset with the lowest ID could be show at week 1 and so on. Any ideas?

  2. #2
    Join Date
    Dec 1969

    Default RE: ...of the week

    It&#039s easy, really.<BR><BR>In week 1, you display record 1, etc. If you get to week 23 and you are at EOF, you just start over again with 1.<BR><BR>Lots of ways to do this.<BR><BR>BUT...I would *NOT* do this by reading the DB each time. I&#039d store the "Record of the Week" in an APPLICATION VARIABLE. Then the only thing I would do is check if the week number had changed and, if so, update the app variable to the new value. That way you&#039d only actually be mucking with the app variable once a week *and* you&#039d get incredibly better performance.<BR><BR>Oh...and you may not have known it, but the DatePart function in VBScript can be used to return the week number of the current date. Simply store that in another application variable and, each time you need the record, check to see if the week number of today&#039s date matches. If not, then and only then is it time to change the app variables. (NOTE: Be sure to wrap the changes to the app variable with Application.Lock and Application.Unlock calls!)<BR><BR>

  3. #3
    perkale Guest

    Default RE: ...of the week

    thanks, that was a really quick reply! i&#039ve never done anything like that before but i will give it a try!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts