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

Select with sum function

Status
Not open for further replies.

roedelfroe

Programmer
Jan 7, 2004
30
DE
Hi,

following problem:

There a two tables with differnt information:

Table A:

Txn-No. Account-No. Sub-Account-No. Amount Item-No.

10 12345 00001 2605 80001
15 12346 00001 2000 80001
20 12346 00001 2000 80001
25 12347 00001 2000 90005
30 12347 00001 2000 80001
35 12348 00001 2000 80001
40 12349 00001 1000 80001
45 12349 00002 1000 80001
50 12350 00001 1000 80001




Table B:

Customer-No. Account-No. Sub-Account-No.

88888 12345 00001
99999 12346 00001
77777 12347 00001
66666 12348 00001
55555 12349 00001
55555 12349 00002
55555 12350 00001


Now I want to know, which customer ordered a certain Item worth more than $2600. I want to see the customer, Txn-No., Amount and Item-no.

So I want to see:

Txn-No. 10
Txn-No. 15 and 20
Txn-No. 40, 45 and 50

Any Ideas how to do this?

So far I've got a solution for the first two problems, so I get Txn-No. 10, 15 and 20, but I've got some trouble with the problem 'customer has multiple accounts'

Thx very much in Advance

Roland
 
Let's see your solution first: [3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top