G Guest Oct 25, 2004 #1 Anyone know a simple SQL statement to retrieve any 5 records from a query? Doesn't matter which 5 either.
Anyone know a simple SQL statement to retrieve any 5 records from a query? Doesn't matter which 5 either.
G Guest Oct 26, 2004 #3 Right on! Now just for kicks, is there any way to randomize the 5 records I get back? Graham Mandeno said: Use the TOP predicate: SELECT TOP 5 .... FROM .... -- Good Luck! Graham Mandeno [Access MVP] Auckland, New Zealand simsjr said: Anyone know a simple SQL statement to retrieve any 5 records from a query? Doesn't matter which 5 either. Click to expand... Click to expand...
Right on! Now just for kicks, is there any way to randomize the 5 records I get back? Graham Mandeno said: Use the TOP predicate: SELECT TOP 5 .... FROM .... -- Good Luck! Graham Mandeno [Access MVP] Auckland, New Zealand simsjr said: Anyone know a simple SQL statement to retrieve any 5 records from a query? Doesn't matter which 5 either. Click to expand... Click to expand...
J John Vinson Oct 26, 2004 #4 Right on! Now just for kicks, is there any way to randomize the 5 records I get back? Click to expand... SELECT TOP 5 ... FROM tablename ORDER BY Rnd([ID]) where ID is some non-negative numeric field in your table. John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps
Right on! Now just for kicks, is there any way to randomize the 5 records I get back? Click to expand... SELECT TOP 5 ... FROM tablename ORDER BY Rnd([ID]) where ID is some non-negative numeric field in your table. John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps