Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SDETERS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple math sql - need help

Status
Not open for further replies.

NTrade

Computer
Jan 10, 2007
7
Am humble...need help w/ basic sql since I don't write it often enough

Sequence Rev SumPast4

1 100 n/a
2 110 n/a
3 105 n/a
4 103 418
5 55 373
6 90 353
etc etc

Table has first 2 columns...need the SumPast4 column created in query showing these three columns... don't need to worry about the n/a example just trying to show that the sum is of the current and past three records...

thanks in advance

 
Replies continue below

Recommended for you

Hi there:

break on report;
compute sum of SumPast4 on report;
select "sequence rev", SumPast4
from "table name"
order by "sequence rev"
/

This should do it for you.

Thanks,

G. Feric, PE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor