Problème sql

Signaler
-
Bonjour, lors de l’exécution de code sql j'ai eu des erreurs:
Ambigous column name 'JS_PK'
The multi part identifier JS.JS_PK could not be bound
Invalid column name JS_pk
The multi part identifier JP.JP_PickupCartageCompleted could not be bound
The multi part identifier LastCompletedProcessTaskValue.P9_Description could not be bound
voici le code
CREATE FUNCTION Report_DHL
(
@CurrentCountry varchar(2)

)
RETURNS TABLE

AS
RETURN

SELECTé

RR_Number = JobShipmentOrderReferenceListValue.Value,
Rate_USD = JK. JK_ConsolChargeableRate,
Origin = JS.JS_RL_NKOrigin,
Destination = JS.JS_RL_NKDestination,
---
PU_Date = JP.JP_PickupCartageCompleted,
Shipper = Consignor.FullName,
Consignee = Consignee.FullName,
HAWB = JS.JS_HouseBill,
---

MAWB = JK.JK_MasterBillNum,
Chargeable_Weight = JS.JS_ActualChargeable,
Actual_Weight = JS.JS_ActualWeight,
PCS = JS.JS_OuterPacks,
ETA = JS.JS_E_ARV,
ControllingAgent = ControllingAgent.OH_Code,
STATUS = LastCompletedProcessTaskValue.P9_Description

FROM dbo.JobShipment AS "JS"
INNER JOIN dbo.JobConShipLink JN ON (JN.JN_JS = JS.JS_PK)

INNER JOIN dbo.Jobconsol JK ON (JK.JK_PK = JN.JN_JK)

LEFT JOIN dbo.csfn_ShipmentMainConsol(@CurrentCountry) AS ShipmentConsolLink ON ShipmentConsolLink.JS_PK = JS.JS_PK
LEFT JOIN dbo.JobConsol AS Consol ON Consol.JK_PK = ShipmentConsolLink.JK_PK
LEFT JOIN dbo.ctfn_JobShipmentOrg('CRD') AS Consignor ON Consignor.JS_PK = JS.JS_PK
LEFT JOIN dbo.ctfn_JobShipmentOrg('CED') AS Consignee ON Consignee.JS_PK = JS.JS_PK
LEFT JOIN dbo.ctfn_JobShipmentOrg('CAG') AS ControllingAgent ON ControllingAgent.JS_PK = JS.JS_PK
LEFT JOIN dbo.JobDocsAndCartage ON JP_ParentID = JS.JS_PK AND JP_ParentTableCode = 'JS'

CROSS APPLY dbo. ctfn_JobShipmentOrderReferenceList(JS_PK, ',') AS JobShipmentOrderReferenceListValue
LEFT JOIN dbo.LastCompletedProcessTask(JS.JS_PK, 'MIL') AS LastCompletedProcessTask ON LastCompletedProcessTask.JS_PK = JS.JS_PK

WHERE (ControllingAgent.OH_Code ='DHLINTER_WW')