Question
· Apr 1, 2023

NOT %INLIST

Hi.

I have a query:

SELECT '['||Material->Sifra||'] '||Material->Opis AS Material,
       SUM(MasaBlago) AS MasaBlago
 FROM Tehtanje.Dokument
 WHERE DatumDokumenta BETWEEN '01/01/2023' AND '04/01/2023'
 AND (Material->Sifra %INLIST $LISTFROMSTRING('5,7',','))
 GROUP BY Material
 ORDER BY %EXACT Material

The query returns all rows where Material->Sifra is 5 or 7. That's OK.

If I want to get all rows where Material->Sifra is NOT 5 or 7 I use query:

SELECT '['||Material->Sifra||'] '||Material->Opis AS Material,
       SUM(MasaBlago) AS MasaBlago
 FROM Tehtanje.Dokument
 WHERE DatumDokumenta BETWEEN '01/01/2023' AND '04/01/2023'
 AND NOT (Material->Sifra %INLIST $LISTFROMSTRING('5,7',','))
 GROUP BY Material
 ORDER BY %EXACT Material

I get no rows although there are rows with Material->Sifra other than 5 or 7.

If I change the query to (not using Material->Sifra but just Material in %INLIST condition):

SELECT '['||Material->Sifra||'] '||Material->Opis AS Material,
       SUM(MasaBlago) AS MasaBlago
 FROM Tehtanje.Dokument
 WHERE DatumDokumenta BETWEEN '01/01/2023' AND '04/01/2023'
 AND NOT (Material %INLIST $LISTFROMSTRING('5,7',','))
 GROUP BY Material
 ORDER BY %EXACT Material

then I get the expected result.

Property Sifra is IDKEY for class Material.

Is this a bug?

Regards,
Matjaž

Product version: IRIS 2022.3
$ZV: IRIS for Windows (x86-64) 2022.3 (Build 606U) Mon Jan 30 2023 09:08:55 EST
Discussion (2)1
Log in or sign up to continue