Home Forums SQL Server 2017 SQL Server 2017 - Development Error message "Conversion failed when converting the varchar value 'SD8040' to data type int" RE: Error message "Conversion failed when converting the varchar value 'SD8040' to data type int"

  • patelvoct - Wednesday, March 21, 2018 6:54 AM

    Hi All,
    New to SQL server Management studio and trying to build basic query to extract some data.  Below is query and error message I get.  I know Project filed is varchar and that is why I placed single quote in where condition value. Same result even if I have no quotes or double quotes.  Any help is truly appreciated.- Thank you.
    SELECT 
      [glNumber]
      ,[fund]
      ,[department]
      ,[account]
      ,[project]
      ,[inactive]
    FROM [D014Glwa].[dbo].[GL_GeneralLedger]
    where dbo.GL_GeneralLedger.project =  'CENT01';

    Error message:  Msg 245, Level 16, State 1, Line 2
    Conversion failed when converting the varchar value 'SD8040' to data type int.

    I see nothing in that query which would generate that error. Is [D014Glwa].[dbo].[GL_GeneralLedger] a view, rather than a table?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.