473,407 Members | 2,629 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,407 software developers and data experts.

AutoNumber Sequence Change in Same Table

The AutoNumber sequence in my database is currently formatted as
'000000'. When a new record is created, the AutoNumber would go from
000001, 000002, 000003 and so on. I want to track via AutoNumber the
year each record was created.

Basically, if a record was entered in 2003, the AutoNumber would look
something like 03-000001 and then 03-000002, and so on.

When a record would be entered in 2004, the AutoNumber would look
something like 04-000001 and then 04-000002, and so on.

Hopefully it can all be within the same table.

How do I do this?
Nov 12 '05 #1
2 2851
"Charles Robinson III" <ro******@saiyanprincefox.cjb.net> wrote in message
news:va********************************@4ax.com...
The AutoNumber sequence in my database is currently formatted as
'000000'. When a new record is created, the AutoNumber would go from
000001, 000002, 000003 and so on. I want to track via AutoNumber the
year each record was created.

Basically, if a record was entered in 2003, the AutoNumber would look
something like 03-000001 and then 03-000002, and so on.

When a record would be entered in 2004, the AutoNumber would look
something like 04-000001 and then 04-000002, and so on.

Hopefully it can all be within the same table.

How do I do this?


Bad idea. "smart keys" will almost always give you trouble down the road.
Let the autonumber do what it wants, record the year or date in another
field.
Nov 12 '05 #2
Autonumbers don't 'mean' anything. It's just a convenient way for you to get
Access to generate a unique identifier for you. And the default is a long
integer where each new record has a number which is USUALLY the highest
number +1. But it can be a GUID if you want. But don't try and use them for
anything apart from unique ids. Don't show them to the users.

Mike

"Charles Robinson III" <ro******@saiyanprincefox.cjb.net> wrote in message
news:va********************************@4ax.com...
The AutoNumber sequence in my database is currently formatted as
'000000'. When a new record is created, the AutoNumber would go from
000001, 000002, 000003 and so on. I want to track via AutoNumber the
year each record was created.

Basically, if a record was entered in 2003, the AutoNumber would look
something like 03-000001 and then 03-000002, and so on.

When a record would be entered in 2004, the AutoNumber would look
something like 04-000001 and then 04-000002, and so on.

Hopefully it can all be within the same table.

How do I do this?

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Tom | last post by:
Hi, I am always confused about what to use as the key for a table. Let's say I have a company-employee table. ---* My co-worker likes to use an AutoNumber or Counter as the key for the ...
12
by: deko | last post by:
Is there a way to reset the AutoNumber sequence? I have several tables that use the AutoNumber field as the Primary Key, and I'd like to somehow do an Import/Export that will make remove the...
33
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
26
by: jimfortune | last post by:
Sometimes I use Autonumber fields for ID fields. Furthermore, sometimes I use those same fields in orderdetail type tables. So it's important in that case that once an autonumber key value is...
5
by: Apple | last post by:
May anyone can teach me how to assign a autonumber, I want to create a number that is starting with year(auto change to year 2006) + autonumber (eg. 2005-0001, 2005-0002)
4
by: Vladislav | last post by:
My customers have reported strange behaviour of the locally used modules for running the register on stroke patients, specifically, adding new patient to the register. When analising a sample, I...
8
by: petebeatty | last post by:
I have created a SQL string the properly inserts a record in the table. However, the insert does not occur at the end of the table. Instead it inserts a record after the last record that I viewed....
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
5
by: troy_lee | last post by:
I have a table that has a PK field with the following format: Dyymm123. So that, a typical number might look like this D0806270. The first character is literal and never changes. The next four...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.