Hello, I am not a programmer but a controls engineer on shift to cover the weekend due to staff shortage and we have no notes regarding such kinds of issue.
I am getting this in my Wonderware (SCADA system) error log:
Error converting data type varchar to real.
Warning: Null value is eliminated by an aggregate or other SET operation. --> Source [.Net SqlClient Data Provider] DbClass[16] DbErrorCode[-2146232060] DbLineNumber[249] DbNumber[8114] DbProcedure[sp_S_cspMilkDLAutoCompleteDynamic] DbProvider[DBProviderSQL]
DbState[5] ExceptionType [DB] OrigExceptionType [System.Data.SqlClient.SqlException]
So I looked at the stored procedure and line number 249:
Stored Procedure: [sp_S_cspMilkDLAutoCompleteDynamic]
Lines 249 is the end section of the following code (highlighted one is line 248):
------Update TRUCK DB
UPDATE ctb_MR_TruckData
SET
ctb_MR_TruckData.Status = 'Complete',
ctb_MR_TruckData.[ScaleOutTime] = SDCT.[Transaction_complete_date],
ctb_MR_TruckData.[ActualTare] = SDCT.[Tare_Weight],
ctb_MR_TruckData.[ActualNet] = (SDCT.[Gross_Weight] - SDCT.[Tare_Weight]),
ctb_MR_TruckData.[ToErp] = (
CASE
WHEN TruckDB.[Material] <> 'Milk'
THEN 1
ELSE NULL
END
)
FROM ctb_MR_TruckData TruckDB (NOLOCK)
JOIN @ReadyTrucks rd
ON rd.TruckID = TruckDB.TruckId
JOIN @ScaleDataCompletedTrucks SDCT
ON SDCT.VehicleID = TruckDB.ScanCard
AND CONVERT(VARCHAR,SDCT.Transaction_start_date,0) = CONVERT(VARCHAR,TruckDB.ScaleInTime,0)
_______________________________________________________________________________
Can anyone help with the warning/error/issue please?