-
Concentating Primary Keys
I have an access database which generates (Through autonumber) the primary key. However, I would like to proceed the key with the year and expand the record to read as a four figure number, hence record 1 becomes record 03 - 0001
I do have a date field in the database and would be happy to use that however the date is a full date format (dd/mm/yyyy).
I would also like the key to start again on the 1st Jan so the first record of 2004 would become 04 - 0001.
Any ideas, suggestions, mild insults would be most welcome.
Terry
-
Try This ...
SELECT Format([DateField],"yy") & "-" & Format(CStr([AutoID]),"0000") AS Expr1
FROM tblName;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|