Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Postive AutoNumber?

Status
Not open for further replies.

TheCandyman

Technical User
Sep 9, 2002
761
US
Is it possible to make a positive only autonumber? I don't see a way to do it in the DB, so i may have to make a random number in the code, and then assign it into the DB. Just wondering if anyone has needed this and worked on it before i start.
 
Provided you're not playing with Replica, an access AutoNumber is positive.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Nope, not doing Replication.

The options are 'Replication ID', or 'Long Integer' for the auto number. Then you can pick 'Increment' or 'Random'

I need to have random numbers, which means the number is between -2147483648 to 2147483647. But i don't see a way to make it only positive.
 
That's okay, just hoped there was a DB solution. Otherwise i might have to do a ASP method
Code:
<% 
  Randomize() 
  MyLuckyCharms = INT(Rnd ()*1000000000) 
%>
 
Why not using the Abs function in your query ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That wouldn't distinguish between a and -a in the key field.

TMTOWDI - it's not just for Perl any more
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top