Last post Feb 20, 2010 10:49 AM by shoebmoiz
May 14, 2008 07:43 PM|sdarlinguk|LINK
I would like to display a random "Tip of the Day" on the home page of my site. Tips are stored in an Access database. The following query displays a random record:
SELECT TOP 1 Rnd([ID]*1000) AS Seed, TopTips.Heading, TopTips.Tip
ORDER BY Rnd([ID]*1000);
This query works fine in Access but when use it in my ASP.NET page it displays the same record every time.
Having browsed a number of forums, I find that this is a common problem but I have not found a solution (or at least one designed for a relative beginner to understand).
Can someone advise why the rnd function returns the same record every time and offer a solution.
Many thanks for your help.
Access database query string
access asp.net randomize
May 15, 2008 04:32 AM|Mikesdotnetting|LINK
SELECT TOP 1 Heading, Tip FROM TopTips
ORDER BY Rnd(-10000000*TimeValue(Now())*[ID])
May 15, 2008 05:00 AM|sdarlinguk|LINK
Thanks Mike. That fixed the problem!
Feb 20, 2010 10:49 AM|shoebmoiz|LINK
Thnx a lot for the Query it helped me tooo .... thanx a real lot