I am using Crystal Reports v7. The following is code that works provided that there is only one value returned from the UOM2."UOM_TYPE_CODE"(+) table.field, which is currently '20'. My problem is that an additional value of '25' has been added and could be returned as well.
I need to code where only '20' or '25' get returned or possibly '2*'.
Can I use a substring in the WHERE statement???
Crystal Reports seems to be very particular with it's rules and I am not fluent in SQL. Is this possible? I have tried to organize the layout of the code as best I could to be read.
SELECT
RECEIVER_DETAIL."REC_ID",
RECEIVER_DETAIL."PRODUCT_ID", RECEIVER_DETAIL."RECEIVED_QTY",
RECEIVER_DETAIL."RECEIVED_UOM", RECEIVER_DETAIL."UOM_FAMILY", RECEIVER_DETAIL."MATERIAL_STATUS_CODE",
PRODUCT_MASTER."PMST_ERP_GN_04",
PRODUCT_UOM."EACH_CONVERSION_FACTOR",
UOM2."UOM_FAMILY", UOM2."EACH_CONVERSION_FACTOR"
FROM
"MOVE"."RECEIVER_DETAIL" RECEIVER_DETAIL,
"MOVE"."PRODUCT_MASTER" PRODUCT_MASTER,
"MOVE"."PRODUCT_UOM" PRODUCT_UOM,
"MOVE"."PRODUCT_UOM" UOM2
WHERE
RECEIVER_DETAIL."PRODUCT_ID" = PRODUCT_MASTER."PRODUCT_ID" AND
(RECEIVER_DETAIL."PRODUCT_ID"=
PRODUCT_UOM."PRODUCT_ID" AND
RECEIVER_DETAIL."UOM_FAMILY" = PRODUCT_UOM."UOM_FAMILY" AND
RECEIVER_DETAIL."RECEIVED_UOM"= PRODUCT_UOM."UOM_TYPE_CODE" AND
(RECEIVER_DETAIL."PRODUCT_ID"=
UOM2."PRODUCT_ID"(+) AND
RECEIVER_DETAIL."UOM_FAMILY"=
UOM2."UOM_FAMILY"(+) AND
UOM2."UOM_TYPE_CODE"(+) = '20') AND
RECEIVER_DETAIL.MATERIAL_STATUS_CODE = ANY ('DMG' , 'FRT', 'AVL')
ORDER BY
RECEIVER_DETAIL."PRODUCT_ID" ASC,
RECEIVER_DETAIL."UOM_FAMILY" ASC,
RECEIVER_DETAIL."RECEIVED_UOM" ASC,
RECEIVER_DETAIL."MATERIAL_STATUS_CODE" ASC
I need to code where only '20' or '25' get returned or possibly '2*'.
Can I use a substring in the WHERE statement???
Crystal Reports seems to be very particular with it's rules and I am not fluent in SQL. Is this possible? I have tried to organize the layout of the code as best I could to be read.
SELECT
RECEIVER_DETAIL."REC_ID",
RECEIVER_DETAIL."PRODUCT_ID", RECEIVER_DETAIL."RECEIVED_QTY",
RECEIVER_DETAIL."RECEIVED_UOM", RECEIVER_DETAIL."UOM_FAMILY", RECEIVER_DETAIL."MATERIAL_STATUS_CODE",
PRODUCT_MASTER."PMST_ERP_GN_04",
PRODUCT_UOM."EACH_CONVERSION_FACTOR",
UOM2."UOM_FAMILY", UOM2."EACH_CONVERSION_FACTOR"
FROM
"MOVE"."RECEIVER_DETAIL" RECEIVER_DETAIL,
"MOVE"."PRODUCT_MASTER" PRODUCT_MASTER,
"MOVE"."PRODUCT_UOM" PRODUCT_UOM,
"MOVE"."PRODUCT_UOM" UOM2
WHERE
RECEIVER_DETAIL."PRODUCT_ID" = PRODUCT_MASTER."PRODUCT_ID" AND
(RECEIVER_DETAIL."PRODUCT_ID"=
PRODUCT_UOM."PRODUCT_ID" AND
RECEIVER_DETAIL."UOM_FAMILY" = PRODUCT_UOM."UOM_FAMILY" AND
RECEIVER_DETAIL."RECEIVED_UOM"= PRODUCT_UOM."UOM_TYPE_CODE" AND
(RECEIVER_DETAIL."PRODUCT_ID"=
UOM2."PRODUCT_ID"(+) AND
RECEIVER_DETAIL."UOM_FAMILY"=
UOM2."UOM_FAMILY"(+) AND
UOM2."UOM_TYPE_CODE"(+) = '20') AND
RECEIVER_DETAIL.MATERIAL_STATUS_CODE = ANY ('DMG' , 'FRT', 'AVL')
ORDER BY
RECEIVER_DETAIL."PRODUCT_ID" ASC,
RECEIVER_DETAIL."UOM_FAMILY" ASC,
RECEIVER_DETAIL."RECEIVED_UOM" ASC,
RECEIVER_DETAIL."MATERIAL_STATUS_CODE" ASC