473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to use date and time as unique id in Access 2007?

I would like to concatenate date and time for use as transaction unique identifier in Access 2007 database.
Jan 21 '11 #1
1 2913
TheSmileyCoder
2,322 Expert Mod 2GB
Hi Bayo and welcome to Bytes

A few things, I dont think the standard timer in Access is good enough to use as a unique key, as you can easily have more then 1 transaction per second (and even with more accurate timers, you might still see the same problem, though I wont exclude the possibility that you can find a good enough timer to meet your requirements)

However if you wish to simply timestamp your records, you can use the built in functions:
Now() which gives Date and time (21-01-2011 10:54:56 )
Date() which gives Date (21-01-2011)
Time() which gives just time (10:54:56)

All of these functions can be used both from code, as well as directly from the query window, or you can even state in table design that a field should use Now() as default value. (Field type should of course be Date/Time)

I would suggest that you:
A) Add a autonumber column to your table, and use that as the unique key
B) Add a timestamp column, with default value Now()

That way you should have the information you need. The Date/Time field will tell you when the transaction was performed and the order of the autonumber field can tell you in which order the transactions were processed.


I hope you found this information usefull.
Jan 21 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: mcmcalex | last post by:
is there an easy way to make a date/time field (in Access) convert to a date field (in Excel) when using ms-query? I'm pretty good with xl, but new to access, so apologies if this is covered on p1...
2
by: Rolf | last post by:
Hi all, I Have a web page wich displays some data from an access DB using the Datalist control. I have 1 problem with a field of the type Data/Time. When I display the field using <%#...
5
by: amanda27 | last post by:
I have a database that we use in our department for the status of our projects. In the form when you pick a project from the dropdown list I have a subform that pulls the data entered for the...
5
by: TIJK | last post by:
I'm attempting to create a database that stores details for my college project. But I'm currently in a rut at the moment. I want to be able to store the exact date and time when an order is made,...
8
by: Killer42 | last post by:
Hi all. I have an interesting situation; searching a Date field for my exact value fails, but including it in a range works. I know this sounds like the usual beginner's date/time woes but I...
3
by: mtgriffiths86 | last post by:
I have created a query using Microsoft access that will work out the difference between a time that i enter into the database (HH:MM:SS) and then to take away the current time. I have this working...
1
by: BulbFresh | last post by:
Hi, Quick one for you, i'm importing a file which has a long date and time format, so once imported i update each date field with the correct format (dd/mm/yyyy). I wrote this in on click of a...
1
by: PatdeLux | last post by:
Hi, I have have an Access 2003 application with Sql Express as back end. After migrating the front end to Access 2007, users have a serious problem: One form contains text controls bound to...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
3
by: kate2272 | last post by:
Hi Guys, Thanks heaps for assisting with my last question. I would like to automatically update a new record with date / time but I was wondering if it is possible for it not to live update...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.