A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

MS Access and expression web



 
 
Thread Tools Display Modes
  #1  
Old October 13th, 2007, 11:33 AM posted to microsoft.public.access.queries
ינאי
external usenet poster
 
Posts: 1
Default MS Access and expression web

hy all
i am trying to generate a random query to display a random record of an
access database.

i tried this one :

SELECT TOP 1 [id], [name], [short_review], [last_edit_date], [Photo_small]
From [Books] ORDER BY RND([id])

but i get the same record all the time.
i tried using the SQL command NEWID () instead of RND but ir didnt work.

any suggestions ?

thank - johnathan
  #2  
Old October 13th, 2007, 11:55 AM posted to microsoft.public.access.queries
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default MS Access and expression web

Unless properly seeded, the Rnd function will return the same values each
time.

See http://www.mvps.org/access/queries/qry0011.htm at "The Access Web" for
how to do what you're trying to do.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"????" wrote in message
...
hy all
i am trying to generate a random query to display a random record of an
access database.

i tried this one :

SELECT TOP 1 [id], [name], [short_review], [last_edit_date], [Photo_small]
From [Books] ORDER BY RND([id])

but i get the same record all the time.
i tried using the SQL command NEWID () instead of RND but ir didnt work.

any suggestions ?

thank - johnathan



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:47 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.