Hi everyone,
I have a problem that for me - and everybody I asked - is unsolvable. I have to point out, that I have read only rights on those tables and can’t create tables, views or anything….So here comes the problem:
I have 2 tables. One, where we have the history of everything that’s ever been sent to our customers. I filtered that by a SENDID and it looks like that:
CustomerID; DateLetter; Group; Template; SENDID
23 ; 19.07.2006 ;DM ; MK ; 6573
58 ; 19.07.2006 ;DM ; MK ; 6573
We regularly categorize and re-categorize our customers in “Stages” depending on amount and frequency of payment (RFM). That table looks like this:
CustomerID Stage DateStage
23 ; A ; 31.12.1999
23 ; B ; 11.03.2011
23 ; G ; 15.08.2015
58 ; B ; 01.01.2002
58 ; F ; 03.04.3005
58 ; C ; 06.08.2009
58 ; B ;15.08.2015
Now we need to do an analysis on how those stages develop over time. I need to know what stage the customer had on the date of the letter “DateLetter”. Result should be that on the “DateLetter” date (19.7.2006) CustomerID 23 was Stage A and CustomerID 58 was Stage F. Something like that:
CustomerID DateLetter Group Template Code Stage
23 ;19.07.2006 ;DM ;MK; 6573; A
58 ;19.07.2006 ;DM ;MK ;6573; F
If only I had a DateStage “Enddate” then I could filter on that, but I don’t. Any ideas? I can explain more if you like/need
Thanks already for taking time to think about problems that aren’t yours and for maybe solving things that I actually get paid for (undeserved apparently).
SQLBUNNY