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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random Number w/DB Check or time/date

Status
Not open for further replies.

Corneliu

Technical User
Sep 16, 2002
141
US
What would be easier to do/create?

1:
I want to create a particular number as an invoice #.

How can I create a random number from say 1-500000 and check against a database? If the number is found in the database, than go back to the beginning and start over to create another one and check again until the number created is NOT in the database so that I can put it in a variable for later use.

OR,
2:
How can I take the date and time, remove the separators (the / from the date and the : from the time) and create a unique ID?

Probably the second choice would be easier, I think. Any suggestions and how to do this?

THANK YOU
 
Sorry, never mind, I took the second choice and figure it out.

THANK YOU...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top