G
Guest
I have spent the last several days looking on this site for any help for
calculating a 7 day high and 7 day low. I have found many discussions about
dates and using the current dates for calculations. I need to find the 7 day
high and low for dates that occured in the past, normally one to two years
ago.
I have a table with the following fields:
Date (Date of temperature)
Time (temp is taken every 1/2 hour)
Temp (in celcius)
Site (id number for site)
There are over 6000 records for each site in a separate table (there are 37
sites). I am mainly interested in the daily averages, minimums and maximums
so I created a query with the following fields and calculations which group
by date:
[date]
[average_temp]
[minimum_temp]
[maximum_temp]
results look like this:
DATE AVERAGE_TEMP MINIMUM_TEMP MAXIMUM_TEMP
5/26/2005 23.19 20.97 25.91
5/27/2005 20.29 18.05 24.52
5/28/2005 17.42 15.97 19.02
5/29/2005 16.16 14.71 17.73
5/30/2005 17.80 15.02 22.31
5/31/2005 17.04 15.82 19.34
6/1/2005 15.77 14.55 18.22
6/2/2005 15.78 14.08 18.37
6/3/2005 17.04 13.31 22.81
I need to gather the running seven day highs and lows from these
calculations. For this one site (there are 37 total) I have a starting date
of 5/26/2005 and ending date of 10/06/05. The dates will be different in
each site.
For example the result I need is the following:
DATE 7 day high 7 day low
5/26/2005 0 0 No 7 day data available
5/27/2005 0 0 No 7 day data available
5/28/2005 0 0 No 7 day data available
5/29/2005 0 0 No 7 day data available
5/30/2005 0 0 No 7 day data available
5/31/2005 0 0 No 7 day data available
6/1/2005 25.91 14.55 using data from 5/26-6/1
6/2/2005 24.52 14.08 using data from 5/27-6/2
6/3/2005 22.81 13.31 using data from 5/28-6/3
ETC........through 10/06/2005
I am no expert at access and have never used Visual Basic so please be
gentle with me. However, I am very interested in increasing my skills and
would appreciate any suggestions on how to learn VBA for access on a limited
budget.
Thanks in advance for your help.
calculating a 7 day high and 7 day low. I have found many discussions about
dates and using the current dates for calculations. I need to find the 7 day
high and low for dates that occured in the past, normally one to two years
ago.
I have a table with the following fields:
Date (Date of temperature)
Time (temp is taken every 1/2 hour)
Temp (in celcius)
Site (id number for site)
There are over 6000 records for each site in a separate table (there are 37
sites). I am mainly interested in the daily averages, minimums and maximums
so I created a query with the following fields and calculations which group
by date:
[date]
[average_temp]
[minimum_temp]
[maximum_temp]
results look like this:
DATE AVERAGE_TEMP MINIMUM_TEMP MAXIMUM_TEMP
5/26/2005 23.19 20.97 25.91
5/27/2005 20.29 18.05 24.52
5/28/2005 17.42 15.97 19.02
5/29/2005 16.16 14.71 17.73
5/30/2005 17.80 15.02 22.31
5/31/2005 17.04 15.82 19.34
6/1/2005 15.77 14.55 18.22
6/2/2005 15.78 14.08 18.37
6/3/2005 17.04 13.31 22.81
I need to gather the running seven day highs and lows from these
calculations. For this one site (there are 37 total) I have a starting date
of 5/26/2005 and ending date of 10/06/05. The dates will be different in
each site.
For example the result I need is the following:
DATE 7 day high 7 day low
5/26/2005 0 0 No 7 day data available
5/27/2005 0 0 No 7 day data available
5/28/2005 0 0 No 7 day data available
5/29/2005 0 0 No 7 day data available
5/30/2005 0 0 No 7 day data available
5/31/2005 0 0 No 7 day data available
6/1/2005 25.91 14.55 using data from 5/26-6/1
6/2/2005 24.52 14.08 using data from 5/27-6/2
6/3/2005 22.81 13.31 using data from 5/28-6/3
ETC........through 10/06/2005
I am no expert at access and have never used Visual Basic so please be
gentle with me. However, I am very interested in increasing my skills and
would appreciate any suggestions on how to learn VBA for access on a limited
budget.
Thanks in advance for your help.