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

should I be using arrays?

Status
Not open for further replies.

drrocket5292

Technical User
Sep 6, 2005
73
US
I have a database that has a list of customer accounts, customer names and customer account codes. Its kind of complicated but there are all sorts of account codes and most of them are similar to each other. Some say the customer has been with us for more than a year some say more than three years. What I am trying to do is match a customers account to any other accounts that customer might have that are in the same group as this one. There are basically six groups of account codes. Account Type A under one year, Account Type B under one year, Account type A 1-3 years, Account type B 1-3 years, Account type A 3+years, Account type B 3+ years. Each one of these groups has like 15 codes in them that are all slightly different things but these differences are negligible to me. What I want to do is have something that says: take the account code of this account, if it is Account type A under 1 year, show me all of the other accounts that this one customer has that are also Account type A under 1 year. Does anyone know how I can do this? Thanks.
 
drrocket,
'Each one of these groups has like 15 codes in them that are all slightly different things but these differences are negligible to me.'
But they are not negligible to computer logic. Can we see a few samples of the 96 account codes so someone can determine if there is a way to sort things out. By-the-way: it seems to me that your db should be structured with a separate table and a one-to-many relationship for the account codes.
Gotta go to church. Will be back around noon PST.
jim
 
xaf924,
my codes are used organized like this:

under 1 year - Account Type A
501, 502, 522, 524, 525, 701, 702, 722, 724,725, 801, 802, 822, 824, 825, 800 300

under 1 year - Account Type B
022, 024, 002, 025, 102, 122, 124, 125, 902, 922, 924, 925

1-3 years - Account Type A
503, 504, 505, 523, 526, 550, 703, 704, 705, 723, 726, 750, 803, 804, 805, 823, 826, 850, 580, 780, 880

etc.

I had a couple of sentences in my last post that I phrased wrong. What I am trying to do is to be able to see all of the accounts that one customer has in the same class. For example, if my list has a customer that has an 022 account I would like to see all of his accounts of type 022, 024, 002, 025, 102, 122 ,124, 125, 902, 922, 924, 925

Are you saying it would be best to put these codes in separate tables and use queries?
 
and are these codes stored in a table? Are there any other tables that they are related too? What does the data look like in the tables and what do you want your expected results to look like?


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
I went ahead and built 6 tables with these codes in them. for instance, table CDunder1Year has all of the codes for under 1 year type A accounts and CDIRUnder1Year has all of the codes for under 1 year type B accounts etc. I have a table that has the customerID and account number and then one that has eevery account number eith their corresponding account code as well as other information like the date the account was opened in it. what I want to do is query these two tables together so that I have all of the accounts that have an opening date of yesterday then compare the account code of all of the accounts in that query to the master tables so that I get every past account for each customer that is in the same class. I.E. if a customer opened an account yesterday of under 1 year type A, then I want to see every account he has opened in the past of under 1 year Type A.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top