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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any have a suggestion as to the bes

Status
Not open for further replies.

ScottNeth

Technical User
Joined
Mar 11, 2002
Messages
44
Location
US
Any have a suggestion as to the best way to do this? I'm entering data into a SQL database on customers - each customer's unique identifier (i.e., the primary key in the db) is what's called a BTN (business telephone number) with a &quot;cust. code&quot; (customer code) at the end of it. I use these 13 digit numbers EVERYTHING. Now, here's the problem. I'm doing an interface for a customer survey - the people entering the survey information have been using a system that for 30 years has split the BTN/Cust.Code into 4 sets of numbers (area code, nxx [that's the 3 digit number before the dash], customer line [four digits at the end of your phone number], and customer code) - and they're being <b>very</b> adament about that being the only way they'll enter the numbers into any survey...ok...anybody know a good way to concatate the four seperate numbers into one column which is the primary key, while still having four seperate fields (I can actually use the idividual area codes seperate) containing the elements of the numbers. By the way - thanks Cheech and LadyBorg - you guys have been saving me a whole lotta stress.
Cyberpunk Scott Neth
Web Designer/Cyberpunk
 
I can think of a couple of methods for this - and it would work together rather nicely. - if I am understanding you correctly.

I don't do SQL, but this is what I'd do on Access.

If you have 3 input box's for the numbers

like

[BOX1]-[BOX2]-[BOX#3]

Name them individually as fields into your database.

use box3 as your unique identifier

So box1 could be
CUSTArea
box2 could be
CUSTcity
and box 3
CUSTID

Just specify in the database that the last four cannot have duplicates.

and afterwards if you are inserting into multiple tables - you could bring CUSTID into a session variable - and turn around and insert that into other tables (as long as you have made a field for it) which would work relation-wise. &quot;I like a man who grins when he fights.&quot;

-- Prime Minister Winston Churchill

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top