B
brhall
I've got an intersting update query that I can't seem to figure out. What I
am trying to do is identify the records where [O3ppm] is zero and update that
value by averaging the hour before and the hour after. So for hour 1100, the
value should be 0.04 by averaging the [O3ppm] value for the 1000 hour(before)
and the 1200 hour(after).
Any help is greatly appreciated.
Here is a sample of the data:
[ID] [DATE] [TIME] [O3ppm]
30898754 7/1/2005 0 0.02
30898755 7/1/2005 100 0.02
30898756 7/1/2005 200 0.01
30898757 7/1/2005 300 0.02
30898758 7/1/2005 400 0.01
30898759 7/1/2005 500 0.02
30898760 7/1/2005 600 0.02
30898761 7/1/2005 700 0.03
30898762 7/1/2005 800 0.01
30898763 7/1/2005 900 0.03
30898764 7/1/2005 1000 0.02
30898765 7/1/2005 1100 0
30898766 7/1/2005 1200 0.06
30898767 7/1/2005 1300 0.04
30898768 7/1/2005 1400 0.04
30898769 7/1/2005 1500 0.05
30898770 7/1/2005 1600 0.04
30898771 7/1/2005 1700 0.03
30898772 7/1/2005 1800 0.03
30898773 7/1/2005 1900 0.02
30898774 7/1/2005 2000 0.04
30898775 7/1/2005 2100 0.03
30898776 7/1/2005 2200 0
30898777 7/1/2005 2300 0.03
am trying to do is identify the records where [O3ppm] is zero and update that
value by averaging the hour before and the hour after. So for hour 1100, the
value should be 0.04 by averaging the [O3ppm] value for the 1000 hour(before)
and the 1200 hour(after).
Any help is greatly appreciated.
Here is a sample of the data:
[ID] [DATE] [TIME] [O3ppm]
30898754 7/1/2005 0 0.02
30898755 7/1/2005 100 0.02
30898756 7/1/2005 200 0.01
30898757 7/1/2005 300 0.02
30898758 7/1/2005 400 0.01
30898759 7/1/2005 500 0.02
30898760 7/1/2005 600 0.02
30898761 7/1/2005 700 0.03
30898762 7/1/2005 800 0.01
30898763 7/1/2005 900 0.03
30898764 7/1/2005 1000 0.02
30898765 7/1/2005 1100 0
30898766 7/1/2005 1200 0.06
30898767 7/1/2005 1300 0.04
30898768 7/1/2005 1400 0.04
30898769 7/1/2005 1500 0.05
30898770 7/1/2005 1600 0.04
30898771 7/1/2005 1700 0.03
30898772 7/1/2005 1800 0.03
30898773 7/1/2005 1900 0.02
30898774 7/1/2005 2000 0.04
30898775 7/1/2005 2100 0.03
30898776 7/1/2005 2200 0
30898777 7/1/2005 2300 0.03