Autonumber with date included

Y

Yokim

Hi, I'm newbie in Access need help here.
My problem is how to format autonumber with this format:
SP03100100
SP03100101
SP03100102
with ;
"SP" is prefix (character)
"0310" means October 2003
and 0100;0101; 0102 is autonumber (numerik)start from 100
Any help is apreciated

Shallom,
Kim
 
J

Jeff Boyce

Kim

Access' Autonumber doesn't work that way. If you want a numbering system
that does that, you'll have to create your own. See Google.com or mvps.org
for help with "custom autonumber".

However, you DON'T want to do that! It's not a good idea to combine
multiple fields into one (you are combining a prefix, a month, a year, and a
sequential number). Any place you'd need to use such a combination (a form,
a report), you can use a query to build the combination 'on-the-fly'.

It's also not a good idea to try to embed meaning in an ID#. Start with the
notion of 'one field, one fact', and embed meaning in the individual fields.

Good luck!

Jeff Boyce
<Access MVP>
 
M

mdr02125

It is easy and helpful to add a CreateTimeStamp field to each of your
tables and have it add the date and time of when the field was added
automatically inserted.



In table design, set Format to General Date

and Default Value to =Now()



You can do some formatting in the Default Value field such as
Format(Now(),"m/d/yyyy") in order to have it save only the date or time
if this is useful.



Do this IN ADDITION to your index number. Do not use it as an
index number.
 
J

Jeff Boyce

(see in-line)

mdr02125 said:
It is easy and helpful to add a CreateTimeStamp field to each of your
tables and have it add the date and time of when the field was added
automatically inserted.
I suspect you meant "when the row was added...", right?
In table design, set Format to General Date

and Default Value to =Now()



You can do some formatting in the Default Value field such as
Format(Now(),"m/d/yyyy") in order to have it save only the date or time
if this is useful.
Using the Format() function won't change the underlying Date/Time value
stored, just how it gets displayed.
Do this IN ADDITION to your index number. Do not use it as an
index number.

JOPO (just one person's opinion)

Jeff Boyce
<Access MVP>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top