cumulative sum query

wilkesgra

New member
Local time
Today, 15:45
Joined
Sep 28, 2010
Messages
1
Hello,

I have a query building a table named (idpap rus running rain), with columns id, yrdy, and ru_totalrain (the column to be summed, rainfall), please see the attachment.

Can someone suggest an faster query to calculate cumulative rainfall in 1, 2, 3, and 7 days in advance (or records in advance) of each yrdy, including the value on yrdy?

I've been using a select query with dlookups like the following and it takes forever...

RU_TOTALRAIN1D: DLookUp("[RU_TOTALRAIN]","idpap rus running rain","[ID]=" & [ID]-1)+[RU_TOTALRAIN]

Especially for the 7 day cumulative lookup...

Suggestions would be appreciated!
 

Attachments

  • screengrabtable2.GIF
    screengrabtable2.GIF
    18.4 KB · Views: 380

Users who are viewing this thread

Back
Top Bottom