A
annysjunkmail
Hi,
I have been struggling with this query for a while and need some help
from the experts!
I am trying to extract unique records from the following sample list
RefID QtrDate TargetNameTargetID Value
1 30-Jun-05 Target 1 010574 13
1 31-Mar-07 Target 1 010574 16.5
1 31-Dec-07 Target 1 010574 17
1 30-Jun-06 Target 1 010574 20
1 30-Sep-06 Target 1 010574 21
1 31-Mar-06 Target 1 010574 25
2 30-Jun-07 Target 1 010689 4
2 31-Mar-07 Target 1 010689 6
3 30-Sep-05 Target 1 011010 1
3 31-Dec-07 Target 1 011010 1.5
3 31-Dec-07 Target 2 011019 8
3 31-Dec-07 Target 3 011031 1.5
4 31-Dec-07 Target 4 012011 6.5
5 31-Mar-05 Target 1 013069 6.5
5 30-Sep-07 Target 1 013069 2
5 31-Dec-06 Target 1 013069 4.5
6 31-Dec-05 Target 1 013069 6.5
6 31-Dec-06 Target 1 013069 10
6 31-Mar-07 Target 1 013069 11.5
which should read like this...
RefID QtrDate TargetNameTargetID Value
1 31-Dec-07 Target 1 010574 17
2 30-Jun-07 Target 1 010689 4
3 31-Dec-07 Target 1 011010 1.5
3 31-Dec-07 Target 2 011019 8
3 31-Dec-07 Target 3 011031 1.5
4 31-Dec-07 Target 4 012011 6.5
5 30-Sep-07 Target 1 013069 2
6 31-Mar-07 Target 1 013069 11.5
I am trying to extract unqiue records based on the following logic.
For each RefID show the value by most recent QtrDate where TargetID is
unqiue
Hoping for some expert help
Chris
I have been struggling with this query for a while and need some help
from the experts!
I am trying to extract unique records from the following sample list
RefID QtrDate TargetNameTargetID Value
1 30-Jun-05 Target 1 010574 13
1 31-Mar-07 Target 1 010574 16.5
1 31-Dec-07 Target 1 010574 17
1 30-Jun-06 Target 1 010574 20
1 30-Sep-06 Target 1 010574 21
1 31-Mar-06 Target 1 010574 25
2 30-Jun-07 Target 1 010689 4
2 31-Mar-07 Target 1 010689 6
3 30-Sep-05 Target 1 011010 1
3 31-Dec-07 Target 1 011010 1.5
3 31-Dec-07 Target 2 011019 8
3 31-Dec-07 Target 3 011031 1.5
4 31-Dec-07 Target 4 012011 6.5
5 31-Mar-05 Target 1 013069 6.5
5 30-Sep-07 Target 1 013069 2
5 31-Dec-06 Target 1 013069 4.5
6 31-Dec-05 Target 1 013069 6.5
6 31-Dec-06 Target 1 013069 10
6 31-Mar-07 Target 1 013069 11.5
which should read like this...
RefID QtrDate TargetNameTargetID Value
1 31-Dec-07 Target 1 010574 17
2 30-Jun-07 Target 1 010689 4
3 31-Dec-07 Target 1 011010 1.5
3 31-Dec-07 Target 2 011019 8
3 31-Dec-07 Target 3 011031 1.5
4 31-Dec-07 Target 4 012011 6.5
5 30-Sep-07 Target 1 013069 2
6 31-Mar-07 Target 1 013069 11.5
I am trying to extract unqiue records based on the following logic.
For each RefID show the value by most recent QtrDate where TargetID is
unqiue
Hoping for some expert help
Chris