M
Monish
Hi
I hope someone can help me with this - I have a feeling it is fairly simple...
I have a query which has been sorted (by 2 date fields) and grouped (by ID).
I need now to select only the first record from each group. Dataset looks
like below:
ID Acct Name Seg Plan % To Plan Last Date Next Date
A8B ABC Co 2 496 17.34% 12/5/08 4/24/09
A8B ABC Co 2 496 17.34% 12/5/08 10/15/09
A8B ABC Co 2 496 17.34% 12/5/08 2/15/10
A8B ABC Co 2 496 17.34% 9/19/08 4/24/09
0RV XYZ Co. 1 82 30.49% 2/6/09 5/15/09
0RV XYZ Co. 1 82 30.49% 2/6/09 9/15/09
0JM AAAA Inc. 1 15 6.67% 1/28/09 6/15/09
A5G LMNO Co 2 254 25.20% 3/20/09 8/15/09
A5G LMNO Co 2 254 25.20% 3/20/09 12/15/09
A5G LMNO Co 2 254 25.20% 10/24/08 8/15/09
AWP QRS Inc 2 170 19.41% 3/6/09 7/15/09
AWP QRS Inc 2 170 19.41% 3/6/09 11/1/09
What I need returned from this is:
ID Acct Name Seg Plan % To Plan Last Date Next Date
A8B ABC Co 2 496 17.34% 12/5/08 4/24/09
0RV XYZ Co. 1 82 30.49% 2/6/09 5/15/09
0JM AAAA Inc. 1 15 6.67% 1/28/09 6/15/09
A5G LMNO Co 2 254 25.20% 3/20/09 8/15/09
AWP QRS Inc 2 170 19.41% 3/6/09 7/15/09
Essentially, the first record for each ID is what I need...
I appreciate any help...thanks for reading.
I hope someone can help me with this - I have a feeling it is fairly simple...
I have a query which has been sorted (by 2 date fields) and grouped (by ID).
I need now to select only the first record from each group. Dataset looks
like below:
ID Acct Name Seg Plan % To Plan Last Date Next Date
A8B ABC Co 2 496 17.34% 12/5/08 4/24/09
A8B ABC Co 2 496 17.34% 12/5/08 10/15/09
A8B ABC Co 2 496 17.34% 12/5/08 2/15/10
A8B ABC Co 2 496 17.34% 9/19/08 4/24/09
0RV XYZ Co. 1 82 30.49% 2/6/09 5/15/09
0RV XYZ Co. 1 82 30.49% 2/6/09 9/15/09
0JM AAAA Inc. 1 15 6.67% 1/28/09 6/15/09
A5G LMNO Co 2 254 25.20% 3/20/09 8/15/09
A5G LMNO Co 2 254 25.20% 3/20/09 12/15/09
A5G LMNO Co 2 254 25.20% 10/24/08 8/15/09
AWP QRS Inc 2 170 19.41% 3/6/09 7/15/09
AWP QRS Inc 2 170 19.41% 3/6/09 11/1/09
What I need returned from this is:
ID Acct Name Seg Plan % To Plan Last Date Next Date
A8B ABC Co 2 496 17.34% 12/5/08 4/24/09
0RV XYZ Co. 1 82 30.49% 2/6/09 5/15/09
0JM AAAA Inc. 1 15 6.67% 1/28/09 6/15/09
A5G LMNO Co 2 254 25.20% 3/20/09 8/15/09
AWP QRS Inc 2 170 19.41% 3/6/09 7/15/09
Essentially, the first record for each ID is what I need...
I appreciate any help...thanks for reading.