‎2007 Jul 20 4:47 AM
Hi all,
in the select statement below i have two fields 'augst' and 'augob'. they can hold values '9' and 'X' respectively. I should ignore the records if any one of the field has value or if both have values. iam able to get it correct for the later query but how can i ignore the records if any one of the fields hold a value.
SELECT opbel budat waers betrw INTO TABLE rev_doc FROM dfkkop
WHERE vkont = contractaccount
AND hvorg = '6000'
AND tvorg = '1412'
AND augst NE '9'
AND augob NE 'X'.
Please send your suggestions,
Raj.
‎2007 Jul 20 4:50 AM
Hi
Try this
SELECT opbel budat waers betrw INTO TABLE rev_doc FROM dfkkop
WHERE vkont = contractaccount
AND hvorg = '6000'
AND tvorg = '1412'
AND augst EQ ' '
AND augob EQ ' '.
or
SELECT opbel budat waers betrw INTO TABLE rev_doc FROM dfkkop
WHERE vkont = contractaccount
AND hvorg = '6000'
AND tvorg = '1412'
AND augst IS INITIAL
AND augob IS INITIAL.
‎2007 Jul 20 4:50 AM
Hi
Try this
SELECT opbel budat waers betrw INTO TABLE rev_doc FROM dfkkop
WHERE vkont = contractaccount
AND hvorg = '6000'
AND tvorg = '1412'
AND augst EQ ' '
AND augob EQ ' '.
or
SELECT opbel budat waers betrw INTO TABLE rev_doc FROM dfkkop
WHERE vkont = contractaccount
AND hvorg = '6000'
AND tvorg = '1412'
AND augst IS INITIAL
AND augob IS INITIAL.
‎2007 Jul 20 4:50 AM
Try out in this way
SELECT opbel budat waers betrw INTO TABLE rev_doc FROM dfkkop
WHERE vkont = contractaccount
AND hvorg = '6000'
AND tvorg = '1412'
AND augst = ' ' and augob = ' ' .
‎2007 Jul 20 4:51 AM
hi
if augst ne '' or augob NE ''.
error message "or u dont write anything here.
else
SELECT opbel budat waers betrw INTO TABLE rev_doc FROM dfkkop
WHERE vkont = contractaccount
AND hvorg = '6000'
AND tvorg = '1412'
AND augst NE '9'
AND augob NE 'X'.
endif.
it will work for u
regards
ravish
<b>plz dont forget to reward if useful</b>
‎2007 Jul 20 4:57 AM
hi raj,
u can define u query in this fashion....
SELECT opbel budat waers betrw INTO TABLE rev_doc FROM dfkkop
WHERE vkont = contractaccount
AND hvorg = '6000'
AND tvorg = '1412'
AND ( augst NE '9' and augob NE 'X' ) OR
( augst NE '9' and augob NE ' ' ) OR
( augst NE ' ' and augob NE 'X' ) .
this may help u.
please reward incase usefull...
regards,
prashant