Information générale
Catégorie:
Codage, syntaxe et commandes
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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement