Avatar of maximyshka
maximyshka
 asked on

Use "-" in the unique field

Hi, does it make any difference whether or not I will use "-" in the Unique number field.

Example "1111111111-222222".  We have such field in master file for reporting purposes.

Unique field is the main field we use for programming, groupping, indexing, reporting etc.

Is this OK to use field "1111111111-222222" or I have to use field "1111111111222222" as primary key and use field ""1111111111-222222" for reporting purposes
Microsoft AccessSQL

Avatar of undefined
Last Comment
maximyshka

8/22/2022 - Mon
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Why not use the Access Auto Number as your Primary Key ... then it becomes a non-issue.

mx
lee555J5

You can use "-" in a unique number field. However, it is obviously text and not a number. Neither will it be automatically incremented as an Autonumber type. Your only requirements would be uniqueness.
maximyshka

ASKER
I have a field in the format 1111111121-2222222 which I want to use as primary key. Yes this field i text. Incrementing not needed
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
lee555J5

Then, yes, you may include and use the "-".

Lee
maximyshka

ASKER
MX, autonumber will not work.  Value "1111111121-2222222" is uniquely identify all information about this loan.

Something similar to composite key

1111111121
2222222
ASKER CERTIFIED SOLUTION
lee555J5

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
maximyshka

ASKER
Thanks a lot
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.