2007 Jan 10 8:54 AM
Hallow I doing a select statement for count but its not write I have a error what I doing wrong in this select
<b>SELECT orgeh COUNT( * ) AS orgeh
FROM pa0001
INTO TABLE count_itab
GROUP BY orgeh</b>
WHERE ( persg EQ '6' OR persg EQ '7' OR persg EQ '8' )
AND stell = 'A'
AND orgeh NE '00009999'
AND orgeh = 'Z'.
regards
2007 Jan 10 9:02 AM
1) remove as Orgeh
2) use group by at end of ur where condition
Hi,
Try this code and kindly reward points by clicking the star on the left of reply,if it helps.
data : begin of count_itab,
orgeh type pa0001-orgeh,
count type i,
end of count_itab.
SELECT orgeh COUNT( * )
FROM pa0001
INTO TABLE count_itab
WHERE ( persg EQ '6' OR persg EQ '7' OR persg EQ '8' )
AND stell = 'A'
AND orgeh NE '00009999'
AND orgeh = 'Z'
GROUP BY orgeh.
2007 Jan 10 8:58 AM
Hi,
Try this code and kindly reward points by clicking the star on the left of reply,if it helps.
data : begin of count_itab,
orgeh type pa0001-orgeh,
count type i,
end of count_itab.
SELECT orgeh COUNT( * )
FROM pa0001
INTO TABLE count_itab
WHERE ( persg EQ '6' OR persg EQ '7' OR persg EQ '8' )
AND stell = 'A'
AND orgeh NE '00009999'
AND orgeh = 'Z'
GROUP BY orgeh.
2007 Jan 10 9:01 AM
Hi,
Try this
SELECT orgeh COUNT( * )
FROM pa0001
INTO TABLE count_itab
WHERE persg IN ( '6' , '7' , '8' )
AND stell = 'A'
AND orgeh NE '00009999'
AND orgeh = 'Z'
GROUP BY orgeh.Y u have specified two conditions for a single field?
AND orgeh NE '00009999'
AND orgeh = 'Z'
2007 Jan 10 9:02 AM
1) remove as Orgeh
2) use group by at end of ur where condition
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |