Try the below:
DECLARE @DATEPROCESS DATETIME; SET @DATEPROCESS = CAST(DATEADD(D, -((DATEPART(WEEKDAY, GETDATE()) + 1 + @@DATEFIRST) % 7), GETDATE()) AS DATE) insert into tempjoin([PART], [SPLRNAME], [SHIPDAYS], [SPRICE]) Select distinct RC.CAT_PART AS PART, RC.CAT_SUPPLIER AS SUPPLIER, FFC.[Ships Within Days] AS SHIPDAYS, ffc.[Sell Price] AS SPRICE from fri_full_Catalog FFC INNER JOIN R5PARTS RP ON (RP.PAR_UDFCHAR06 = FFC.[DSSI ITEM #] AND RP.PAR_ORG='USA' AND FFC.fri_Org='USA' and FRI_CREATED=@DATEPROCESS) INNER JOIN R5CATALOGUE RC ON RP.PAR_CODE=RC.CAT_PART AND RC.CAT_PART_ORG='USA' AND (RC.CAT_SUPPLIER=REPLACE(REPLACE([SPLR NAME],'&','-'), '''', '') and ((FFC.[Ships Within Days] <> RC.CAT_LEADTIME) OR (FFC.[Sell Price]<> RC.CAT_GROSS)))
Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
[Blog]
No comments:
Post a Comment