Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NewID() analogue in Access
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00773732
Message ID:
00775983
Vues:
23
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform