Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Column default: concatenate from two other columns? 1

Status
Not open for further replies.

VBAjedi

Programmer
Dec 12, 2002
1,197
KH
Hi all!

Is there a way to set a column's default value to be a concatenation of two other columns' values (which will never contain a null value)? I.e. value in column "TableKey" will always = value in column "RegionNum" + value in column "CustID". I want to use a concatenation of those two values as my primary key, but I want the key value to actually be written in the table.

Thanks!

VBAjedi [swords]
 
Is there a way to set a column's default value to be a concatenation of two other columns' values (which will never contain a null value)?

No.

Why do you want to store redundant data?
 
I just thought it would make writing queries cleaner and easier if I didn't have to CONCAT every time I want to use that value (which will be often).

Well, it isn't so bad to do something that's a little awkward if you know you made a decent effort to find a faster way first.

;^)

Knowing that is worth a star. Thanks!

VBAjedi [swords]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top