By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,678 Members | 2,402 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,678 IT Pros & Developers. It's quick & easy.

Random record each day

P: n/a
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

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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 :}

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Pete via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message
news:29******************************@DotNetMonste r.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

--
Message posted via http://www.dotnetmonster.com

Nov 19 '05 #2

P: n/a
Thanks so much

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.