Solved

Conversion failed when converting the nvarchar value 'China Exclusive Products - purchases inc Paper Bags' to data type int.

Posted on 2011-09-02
2
350 Views
Last Modified: 2012-05-12
Umm SQL conversion query...

My Select statement is -

SELECT 
ID,  
Code +  [General-Ledger-Account] 
AS NominalCode 
FROM dbo.[Nominal-Codes] 
Order by Code

Open in new window


ID is an Int
Code is an INT
[General-Ledger-Account]  is nvarchar(100)

Please advise work around..

Thank you
0
Comment
Question by:garethtnash
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
Christopher Gordon earned 500 total points
ID: 36473205
You should CAST the Code field.  Something like this:

SELECT
ID,  
cast(Code as nvarchar(50)) +  [General-Ledger-Account]
AS NominalCode
FROM dbo.[Nominal-Codes]
Order by Code
0
 

Author Closing Comment

by:garethtnash
ID: 36473245
thank you
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question