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

How to create a unique tracking number

Status
Not open for further replies.

logo

Programmer
Aug 22, 2001
56
0
0
US
I would like to create a unique id to use a primary key in a database. What I want to do is grab the number of seconds that have passed since some date in the past. I'm sure VB has a function that will do this for me. Can anyone point me in the right direction.

Thanks
 
Try

Dim lngDiff as long
lngDiff DateDiff("s", date1, date2)
 
Why do you think that would be unique? Peter Meachem
peter@accuflight.com
 
Ok. Lets call it pseudo-unique.

I'm working on developing a company "task" manager and am using this value as tracking number for any tasks or assignments that are submitted. I understand that it would is possible for two people to submit seperate tasks at the exact same second, but this is seems highly unlikely...plus a simple error check will take care of that.

If you have a better solution, then I all ears :)
 
I tried to point you in the right direction.
You asked how to get seconds since a date and I told you.
We can't do everything for you. :)
 
Thanks Bob--you gave me what I needed!

I wasn't asking a follow-up question...I was responding to that last comment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top