G
Guest
SELECT VBELN, POSNR, MATNR, ARKTX, KWMENG, WERKS, ERDAT
FROM VBAP
WHERE KWMENG In (1,2,4);
If I use the query above, using the WHERE...IN.... syntax, it works fine,
returning the same result as if I had typed:
WHERE KWMENG = 1 OR KWMENG = 2 OR KWMENG = 4
Is it possible to use a parameter query, in conjunction with the
WHERE....IN.... syntax, to allow for multiple numbers to be input? I have
tried the following, with varitaions of the data type (integer, text, etc),
but it doesn't work:
PARAMETERS [Qty] Text ( 255 );
SELECT VBELN, POSNR, MATNR, ARKTX, KWMENG, WERKS, ERDAT
FROM VBAP
WHERE KWMENG IN ([Qty]);
or
PARAMETERS [Qty] Short;
SELECT VBELN, POSNR, MATNR, ARKTX, KWMENG, WERKS, ERDAT
FROM VBAP
WHERE KWMENG In ([Qty]);
The reason I am trying to figure this out is that when altering the criteria
on the fly in VBA, I would rather just modify the
QueryDef.Parameters.Parameter property than have to completely reconstruct
the query using the QueryDef.SQL property.
Thanks!
FROM VBAP
WHERE KWMENG In (1,2,4);
If I use the query above, using the WHERE...IN.... syntax, it works fine,
returning the same result as if I had typed:
WHERE KWMENG = 1 OR KWMENG = 2 OR KWMENG = 4
Is it possible to use a parameter query, in conjunction with the
WHERE....IN.... syntax, to allow for multiple numbers to be input? I have
tried the following, with varitaions of the data type (integer, text, etc),
but it doesn't work:
PARAMETERS [Qty] Text ( 255 );
SELECT VBELN, POSNR, MATNR, ARKTX, KWMENG, WERKS, ERDAT
FROM VBAP
WHERE KWMENG IN ([Qty]);
or
PARAMETERS [Qty] Short;
SELECT VBELN, POSNR, MATNR, ARKTX, KWMENG, WERKS, ERDAT
FROM VBAP
WHERE KWMENG In ([Qty]);
The reason I am trying to figure this out is that when altering the criteria
on the fly in VBA, I would rather just modify the
QueryDef.Parameters.Parameter property than have to completely reconstruct
the query using the QueryDef.SQL property.
Thanks!