on 2020 Nov 03 10:01 AM
Dear Friends
Any one help me to modify flowing query for sort out based on supplier group called '' Import vendor'' for po alert management .
SELECT T0."DocNum", T2."CardCode", T2."CardName", T3."U_NAME", T1."ItemCode", T1."Dscription", T1.[OcrCode] AS "Cost Center" ,T4.WhsCode,T4.WhsName,T1."Quantity", T0.[CreateDate] ,T0.[DocTime]
FROM OPOR T0
INNER JOIN DLN1 T1 ON T0."DocEntry" = T1."DocEntry"
INNER JOIN OCRD T2 ON T0."CardCode" = T2."CardCode"
INNER JOIN OUSR T3 ON T0."UserSign" = T3."USERID"
INNER JOIN OWHS T4 ON T4.WhsCode = T1.WhsCode
WHERE CAST(T0."CreateDate" AS DATE) = CAST(GETDATE() AS DATE)
AND CASE WHEN T0."DocTime" < '999' THEN LEFT(T0."DocTime",1) ELSE LEFT(T0."DocTime",2) END = DATEPART(HOUR, DateAdd(MINUTE,-1,Getdate()))
AND RIGHT(T0."DocTime",2) = DATEPART(MINUTE, DateAdd(MINUTE,-1,Getdate()))
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.