Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NewID() analogue in Access
Message
From
10/04/2003 09:00:51
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00773732
Message ID:
00775983
Views:
24
Hi!

MS Access does not have function identical to NewID().

If you have AutoNumber in your table, and know min and max values of autonumber field, you can use RND() function for this, but you would require to run query few times for case it returns no record (if you have "gaps" in sequence of autonumber field values).

BTW, if you can use SQL Server from inside of MS Access, you can easy write SP that will query MS Access data in the same manner :-)

HTH.

>Hi everybody,
>
>I learnt a new trick, if you want to select random record from SQL Server, you can use
>
>select top 1 myFieldList from myTable order by NewID()
>
>I'm wondering, what would be Access analogue?
>
>I've ran a search on google, but came with nothing...
>
>What is the way to get random record in Access database? Or in Oracle?
>
>Thanks in advance.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform