Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to select records with a number of conditions.
However, it seems like the SQL statement ignores the extra OR's. Is there another way to make this selection?
The database includes more than 30 types of smov2_action so excluding is no option.
try below
LOAD
smov2_part as [Part],
smovqty as [Value],
date(smov2_date) as [Date];
SQL SELECT
smov1_rec_type,
smov2_action,
smov2_part,
smov2_date,
smovqty
FROM SMOV_DATA
WHERE smov1_co_site = 1
AND (smov2_action = 'UPLISS'
OR smov2_action = 'UPLREC'
OR smov2_action = 'SALISS'
OR smov2_action = 'WIPISS'
OR smov2_action = 'WIPREC'
OR smov2_action = 'WIPRRV'
OR smov2_action = 'NILSTK');
Hi
I would do it like this:
[StockMovements]:
LOAD
smov2_part as [Part],
smovqty as [Value],
date(smov2_date) as [Date]
;
SQL SELECT
smov2_part,
smov2_date,
smovqty
FROM SMOV_DATA
WHERE smov1_co_site = 1
AND smov2_action IN ('UPLISS', 'UPLREC', 'SALISS', 'WIPISS', 'WIPREC', 'WIPRRV', 'NILSTK')
;
No need to SELECT items not used in the load.
Hope that helps
Jonathan