incrementing date as a primary key?

chris davies

Registered User.
Local time
Today, 08:28
Joined
Mar 20, 2005
Messages
86
As a primary key, I am using a date, well, at least it is unique, yes? Even if it isn't ideal.
Is there a way of making the date autoincrement, like the autonumber does?
I thought it may be easier than having to type in a date every day, also the application I am working on will need to have dates stored against employee worked hours per day. Therefore, depending on how many employees there may be, will determine how many times the date has to be entered for that day. Might save some aching fingers :cool:. Hope you get my meaning.

Thanks to all assistance offered.
 
You can set the default value of a new record:
Fieldname: Timestamp
Default Value: =Now()

Enjoy!
 

Attachments

Hi there,
Thanks for the prompt reply, is it possible to have the Date without the hours, minutes and seconds? Although your suggestion does help immensly thank you
 
silly me, all I had to do is use the format option in design view doh:D
 
Last edited:
Use Date() to get the date without the time, Time() to get the time without the date. Finally use Now() to get a timestamp, both date and time.

Using the Format function you can switch any part of the date or time forward or backward in the resulting string.

Enjoy!
 

Users who are viewing this thread

Back
Top Bottom