G
GPO
I have a table of data that looks like this:
Value Date_Of_Value_Change
A 31/12/2003
B 14/1/2004
A 16/1/2004
B 19/1/2004
What it means is that a thing had a value of A starting on 31/12/2003 and
going up to (but not including) 14/1/2004. 14 days all up for that period.
Then it went to B for two days and so on. I need to work out a query that
will give me (for the period 31/12/2003 to 20 /1/2004):
Time as A: 17 days.
Time as B: 4 days.
Any suggestions gratefully accepted. I need a fairly efficient solution as
the real table will be several hundred thousand records long.
Regards
GPO
Value Date_Of_Value_Change
A 31/12/2003
B 14/1/2004
A 16/1/2004
B 19/1/2004
What it means is that a thing had a value of A starting on 31/12/2003 and
going up to (but not including) 14/1/2004. 14 days all up for that period.
Then it went to B for two days and so on. I need to work out a query that
will give me (for the period 31/12/2003 to 20 /1/2004):
Time as A: 17 days.
Time as B: 4 days.
Any suggestions gratefully accepted. I need a fairly efficient solution as
the real table will be several hundred thousand records long.
Regards
GPO