If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Subquery?
I have a table looking like this:
Timekey Value ********** ******* 1 1.3 2 1.45 3 1.5 4 1.4 5 1.6 6 1.8 I now would like to generate a table, showing the Max Value of a interval with a specific length (let's assume 3) starting at every possible Timekey. To make this clearer – the result should look like this: Start_Interval_Timkey Max_Value_Interval ********************** *********************** 1 1.5 (Comment: the relevant values were 1.3, 1.45, 1.5) 2 1.5 3 1.6 4 1.8 Can someone help??? |
#2
|
|||
|
|||
Subquery?
IF your timekey is always sequential, then you could do something like.
SELECT M.TimeKey, DMax("[Value]","Table", "TimeKey =" & M.TimeKey & " AND TimeKey " M.TimeKey + 2) as NewMax FROM Table as M If Timekey is not a sequential number then this becomes more complex. Chris wrote: I have a table looking like this: Timekey Value ********** ******* 1 1.3 2 1.45 3 1.5 4 1.4 5 1.6 6 1.8 I now would like to generate a table, showing the Max Value of a interval with a specific length (let's assume 3) starting at every possible Timekey. To make this clearer – the result should look like this: Start_Interval_Timkey Max_Value_Interval ********************** *********************** 1 1.5 (Comment: the relevant values were 1.3, 1.45, 1.5) 2 1.5 3 1.6 4 1.8 Can someone help??? |
Thread Tools | |
Display Modes | |
|
|