General information
Category:
Coding, syntax & commands
Something like:
create table hi (recid c(10), amount n(8))
insert into hi (amount) values (12)
insert into hi (amount) values (10)
insert into hi (amount) values (6)
insert into hi (amount) values (2)
insert into hi (amount) values (22)
insert into hi (amount) values (20)
insert into hi (amount) values (26)
insert into hi (amount) values (22)
replace all recid with padl(alltr(str(recn())),10,"0")
go top
do while not eof()
lnlastid=val(recid)+4
calc sum(amount) to ln while val(recid) '<' lnlastid
insert BEFORE blank
repl amount with ln
skip 1
enddo
>I have a table with numeric values. I would like to sum all the values in one particular column and put the summed value as the next available recno.
>Below is an example of what I'm looking to do:
>
>
>(I.E: I want to sum recno 1 - 4, and put the sum value in recno 5, - summed value would be "30")
>
>(column) Customers
>(recno=1) 12
>(recno=2) 10
>(recno=3) 06
>(recno=4) 02
>(recno=5)
>
>I would like to have syntax that I can use in the command window if at all possible.
>
>Any help would be appreciated.
>
>Thank you,
>Billy
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only