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ž
Comments
if Sifra is the IDKEY of Material what is the difference
between Material (which is the ID already) and Material->Sifra ???
Hi.
No difference, but it should work also with Material->Sifra, shouldn't it?
Regards,
Matjaž