Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Error converting data type nvarchar to bigint.

$
0
0

hi all

i used this t-sql codes

SELECT PAH.TypeRef,PAH.ProductActionHeaderNum,PAH.ProductActionHeaderDate,PAH.AccountDetailRef
 ,AD.AccountDeatil
 ,PAH.StorageRef ,S.StoragesName 
 ,PAH.ProductActionHeaderComment
 ,PAH.SendDocNum
 ,PAI.ProductRef,P.ProductName,U.UnitName,PAI.Quanty
  FROM dbo.ProductActionHeader PAH 
 INNER JOIN dbo.ProductActionItem PAI ON PAH.ProductActionHeaderId=PAI.ProductActionHeaderRef 
 INNER JOIN dbo.AccountDetail AD ON AD.AccountDetailId=PAH.AccountDetailRef
 INNER JOIN dbo.Product P ON P.ProductId =PAI.ProductRef 
 INNER JOIN dbo.Unit U ON U.UnitId=P.UnitRef
 INNER JOIN DBO.Storages S ON S.StoragesId =PAH.StorageRef 
 WHERE PAH.TypeRef=1   AND P.HasPrice=0
 UNION
 SELECT PAH.TypeRef,PAH.ProductActionHeaderNum,PAH.ProductActionHeaderDate,PAH.AccountDetailRef
 ,AD.AccountDeatil
  ,PAH.StorageRef ,S.StoragesName 
  ,PAH.SendDocNum
 ,PAH.ProductActionHeaderComment
 ,PAI.ProductRef,P.ProductName,U.UnitName,PAI.Quanty 
  FROM dbo.ProductActionHeader PAH 
 INNER JOIN dbo.ProductActionItem PAI ON PAH.ProductActionHeaderId=PAI.ProductActionHeaderRef 
 INNER JOIN dbo.AccountDetail AD ON AD.AccountDetailId=PAH.AccountDetailRef
 INNER JOIN dbo.Product P ON P.ProductId =PAI.ProductRef 
 INNER JOIN dbo.Unit U ON U.UnitId=P.UnitRef
  INNER JOIN DBO.Storages S ON S.StoragesId =PAH.StorageRef 
 WHERE PAH.TypeRef=2 AND    P.HasPrice=0
 ORDER BY  PAH.ProductActionHeaderDate,PAH.ProductActionHeaderNum,PAH.TypeRef,PAI.ProductRef


but i see this error

Msg 8114, Level 16, State 5, Line 2
Error converting data type nvarchar to bigint.

how to solve it

thanks


Name of Allah, Most Gracious, Most Merciful and He created the human


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>