Random record each day

  • Thread starter Thread starter Pete via DotNetMonster.com
  • Start date Start date
P

Pete via DotNetMonster.com

Hi,

I need to display a different random record or link each day. I have the
random part working so that if the browser is refreshed a new record will
display. I'm not sure however how to specify that it only happens once a
day. This is the select statement I'm using to generate a random record.

Dim queryString As String = "SELECT Top 1 [tbllinks].[link] FROM [tbllinks]
ORDER BY NEWID()"

Thanks
 
You'll have to store a "date" value somewhere (DB, File, etc) and check this
when it loads to determine if you need the call to the DB for a new record.
I would store the Date & the ID of the record in a table, you can have a
history that way too :}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top