rancidmeat
MIS
I need help with doing the following: First here is the data
Cust_ID Acct_Op_Dte Trans_Date Trans_Amt Store_Loc
12345 2004350 2004350 $160.00 4
12345 2004350 2004355 $160.00 4
54321 2004303 2004306 $0.07 1
54321 2004303 2004306 $2,000.00 1
54321 2004303 2004306 $0.00 1
54321 2004303 2004335 $0.73 1
54321 2004303 2004335 $0.00 1
54321 2004303 2004366 $0.67 1
11111 2004357 2004358 $0.03 1
11111 2004357 2004358 $3,000.00 1
11111 2004357 2004358 $0.00 1
11111 2004357 2004366 $0.33 1
11111 2004357 2004366 $0.00 1
11111 2004357 2005031 $1.01 1
11111 2004357 2005031 $0.00 1
55555 2004357 2004358 $0.59 5
55555 2004357 2004358 $54,000.00 5
55555 2004357 2004358 $0.00 5
55555 2004357 2005031 $18.31 5
Goal: Sum the trans_amt using the trans_amt with the first Trans_Date for each Cust_ID. The legacy DB I am working with does not have this information. I had to create this DB by adding the Acct_Op_Dte from the customer record file to the transaction history file. The DB I created for all accounts opened in October 2004 has over 156,000 records of history for just over 6,300 unique Cust_ID's.
So what I am looking to do is get the following results from a SQL query:
Cust_ID First_Trans_Amt
12345 $160.00
54321 $2,000.07
11111 $3,000.03
55555 $54,000.59
I am too embarassed to share my first several attemps since they did not work.
Thanks in advance for your help.
Cust_ID Acct_Op_Dte Trans_Date Trans_Amt Store_Loc
12345 2004350 2004350 $160.00 4
12345 2004350 2004355 $160.00 4
54321 2004303 2004306 $0.07 1
54321 2004303 2004306 $2,000.00 1
54321 2004303 2004306 $0.00 1
54321 2004303 2004335 $0.73 1
54321 2004303 2004335 $0.00 1
54321 2004303 2004366 $0.67 1
11111 2004357 2004358 $0.03 1
11111 2004357 2004358 $3,000.00 1
11111 2004357 2004358 $0.00 1
11111 2004357 2004366 $0.33 1
11111 2004357 2004366 $0.00 1
11111 2004357 2005031 $1.01 1
11111 2004357 2005031 $0.00 1
55555 2004357 2004358 $0.59 5
55555 2004357 2004358 $54,000.00 5
55555 2004357 2004358 $0.00 5
55555 2004357 2005031 $18.31 5
Goal: Sum the trans_amt using the trans_amt with the first Trans_Date for each Cust_ID. The legacy DB I am working with does not have this information. I had to create this DB by adding the Acct_Op_Dte from the customer record file to the transaction history file. The DB I created for all accounts opened in October 2004 has over 156,000 records of history for just over 6,300 unique Cust_ID's.
So what I am looking to do is get the following results from a SQL query:
Cust_ID First_Trans_Amt
12345 $160.00
54321 $2,000.07
11111 $3,000.03
55555 $54,000.59
I am too embarassed to share my first several attemps since they did not work.
Thanks in advance for your help.