Hi
I have a query which is having an issues with the message of
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value 'AM015044CR' to data type int.
Any ideas please, I have googled and tried cast as you can see, this is the code field which where the 'AM015044CR' would be located in the result. Not hot on coding, I also tried the convert but got the same message. Any ideas please, thanks
The SQL query is as below
I have a query which is having an issues with the message of
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value 'AM015044CR' to data type int.
Any ideas please, I have googled and tried cast as you can see, this is the code field which where the 'AM015044CR' would be located in the result. Not hot on coding, I also tried the convert but got the same message. Any ideas please, thanks
The SQL query is as below
SQL:
SELECT WorksOrderHeader.TotalVolumeIn, CAST(dbo.[148VW_MDF2014p3].[Finished Product] as Int), dbo.[148VW_MDF2014p3].[Raw Board], dbo.[148VW_MDF2014p3].[RB Actual], dbo.[148VW_MDF2014p3].[RB Available],
dbo.[148VW_MDF2014p3].[RB Allocated], dbo.[148VW_MDF2014p3].[RB OnOrder], dbo.[148VW_MDF2014p3].[FP Actual], dbo.[148VW_MDF2014p3].[FP Available],
dbo.[148VW_MDF2014p3].[FP Allocated], dbo.[148VW_MDF2014p3].[FP AwaitingProcessing], dbo.[148VW_MDF2014p3].[FP Sold Last Month],
dbo.[148VW_MDF2014p3].[FP Sold 2 Months Ago], dbo.[148VW_MDF2014p3].[FP Sold 3 Months Ago], SUM(dbo.[148VW_MDF2014p3].[FP Into Loose Last Month])
AS [FP Into Loose Last Month], SUM(dbo.[148VW_MDF2014p3].[FP Into Loose 2 Months Ago]) AS [FP Into Loose 2 Months Ago],
SUM(dbo.[148VW_MDF2014p3].[FP Into Loose 3 Months Ago]) AS [FP Into Loose 3 Months Ago]
FROM dbo.WorksOrderLine INNER JOIN
dbo.WorksOrderHeader ON dbo.WorksOrderLine.WorksOrderID = dbo.WorksOrderHeader.WorksOrderID INNER JOIN
dbo.Product ON dbo.WorksOrderLine.ProductID = dbo.Product.ProductID INNER JOIN
dbo.[148VW_MDF2014p3] ON dbo.Product.ProductID = dbo.[148VW_MDF2014p3].[Finished Product]
Where [Finished Product] = 'am015044cr'
GROUP BY dbo.[148VW_MDF2014p3].[Finished Product], dbo.[148VW_MDF2014p3].[Raw Board], dbo.[148VW_MDF2014p3].[RB Actual],
dbo.[148VW_MDF2014p3].[RB Available], dbo.[148VW_MDF2014p3].[RB Allocated], dbo.[148VW_MDF2014p3].[RB OnOrder], dbo.[148VW_MDF2014p3].[FP Actual],
dbo.[148VW_MDF2014p3].[FP Available], dbo.[148VW_MDF2014p3].[FP Allocated], dbo.[148VW_MDF2014p3].[FP AwaitingProcessing],
dbo.[148VW_MDF2014p3].[FP Sold Last Month], dbo.[148VW_MDF2014p3].[FP Sold 2 Months Ago], dbo.[148VW_MDF2014p3].[FP Sold 3 Months Ago],
dbo.WorksOrderHeader.TotalVolumeIn