C
Corky
Hi,
I have been racking my brains how to sort this one!
eg A
APPOINTMENT DATE Difference in Days
20-Nov-03 0
29-Jan-04 70
01-Apr-04 63
24-Jun-04 84
eg B
APPOINTMENT DATE Difference in Days
20-Nov-03
29-Jan-04 70
07-Jun-04 130
27-Jul-04 50
Above demonstrates some data i have. If there is a difference of
greater than 121 days (4 months) between 2 dates i want the first date
to be pulled out, so in example B I need 29-Jan-04 to be selected. If
the difference between any of the dates is not greater than 121 days,
then i need the last date selecting. In example A, this would be
29-Jun-04.
I have tried several approaches all of which havent worked. I ranked
the dates in order then pulled them into a crosstab. I have then tried
to datediff between each of the ranked dates, but this just seem too
complicated.
Has anyone got any ideas?
I have been racking my brains how to sort this one!
eg A
APPOINTMENT DATE Difference in Days
20-Nov-03 0
29-Jan-04 70
01-Apr-04 63
24-Jun-04 84
eg B
APPOINTMENT DATE Difference in Days
20-Nov-03
29-Jan-04 70
07-Jun-04 130
27-Jul-04 50
Above demonstrates some data i have. If there is a difference of
greater than 121 days (4 months) between 2 dates i want the first date
to be pulled out, so in example B I need 29-Jan-04 to be selected. If
the difference between any of the dates is not greater than 121 days,
then i need the last date selecting. In example A, this would be
29-Jun-04.
I have tried several approaches all of which havent worked. I ranked
the dates in order then pulled them into a crosstab. I have then tried
to datediff between each of the ranked dates, but this just seem too
complicated.
Has anyone got any ideas?