A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Subquery?



 
 
Thread Tools Display Modes
  #1  
Old May 31st, 2004, 09:16 AM
Chris
external usenet poster
 
Posts: n/a
Default 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  
Old May 31st, 2004, 04:16 PM
John Spencer (MVP)
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.