Link to home
Start Free TrialLog in
Avatar of dark22
dark22

asked on

Create a 8 digit auto number

Hi
I have been told we need an 8 digit auto number given to each new record in our table
starting at 00000001.

Can this be done ?

Thanks

Matt
Avatar of Faizan Sarwar
Faizan Sarwar
Flag of United Kingdom of Great Britain and Northern Ireland image

not sure about starting from 00000001
but one option could be to set 8 digit
DBCC CHECKIDENT('YourTable', RESEED, 10000000)
Avatar of Patrick Matthews
Hello dark22,

Why do you need to store the leading zeroes in the database?  Why not let it be a simple int identity column,
and then format the result to be 8 digits in your queries/reports?

Regards,

Patrick
Avatar of dark22
dark22

ASKER

that maybe the way to go, I don't need to store it in the database,
What happens is a query is run in Access 2000 to import certain records from the first DB into an access table.

Can you make the access table format it to 8 digits ?
dark22 said:
>>Can you make the access table format it to 8 digits ?

The same issue applies: you could build the import process to do this, but why bother?
ASKER CERTIFIED SOLUTION
Avatar of dark22
dark22

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial