2009 Oct 13 3:49 PM
Hi,
I am devloping Query with the table DBERCHZ1
it having two fields
V_ ABRMENGE value 456
N_ ABRMENGE value 0.67899
Here i want to print as 456.67899 with one select statment.
is any way to sum in select statment.
Thanks
My select statment as
select ebelnr, htariftyp, csparte, cvertrag, cvkont, mbelzart, cbegabrpe, cendabrpe, sum (mv_abrmenge, mn_abrmenge), e~budat
from erchc as e
join dberchz1 as m
on ebelnr = mbelnr
join erch as c
on mbelnr = cbelnr
join ever as r
on cvertrag = rvertrag
join eanlh as h
on hanlage = ranlage
where h~tariftyp in @p1@
and c~erchc_v = 'X'
and c~simulation = space
and c~tobreleasd = space
and e~budat in @p2@
and e~simulated = space
and e~tobreleasd = space
and m~belzart in @p3@
and m~belnr in @p4@
2009 Oct 13 3:53 PM
My select statment as
select ebelnr, htariftyp, csparte, cvertrag, cvkont, mbelzart, cbegabrpe, cendabrpe, sum (mv_abrmenge, mn_abrmenge), e~budat
from erchc as e
join dberchz1 as m
on ebelnr = mbelnr
join erch as c
on mbelnr = cbelnr
join ever as r
on cvertrag = rvertrag
join eanlh as h
on hanlage = ranlage
where h~tariftyp in @p1@
and c~erchc_v = 'X'
and c~simulation = space
and c~tobreleasd = space
and e~budat in @p2@
and e~simulated = space
and e~tobreleasd = space
and m~belzart in @p3@
and m~belnr in @p4@
2009 Oct 13 3:53 PM
2009 Oct 13 4:03 PM
Hi,
I have just given a code snippet similar to your requirement.
DATA: average TYPE p DECIMALS 2,
sum TYPE p DECIMALS 2.
SELECT AVG( luggweight ) SUM( luggweight )
INTO (average, sum)
FROM sbook.
WRITE: / 'Average:', average,
/ 'Sum :', sum.
.
Just replace with your variables and let me know if it works.
Thanks,
Harini
2009 Oct 13 4:31 PM
in select statment sum two fields and show as one field
select x y x from table
here i want to sum y z
Thanks
2009 Oct 13 4:35 PM
You may be able to do this with native SQL, but I don't see how it can be done in open SQL.
Rob
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |