473,326 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

conversion failed when converting the nvarchar value to data type bit

Good day, I'm getting an error when I'm inserting to my standard table. The below is the code that I have

Expand|Select|Wrap|Line Numbers
  1. Insert into Bidvest.dbo.[Bidvest Database] ([Item], 
  2.   [Cardholder Name], 
  3.   [Date Collected], 
  4.   [Type], 
  5.   [Address1],
  6.   [Address2],
  7.   [Address3],
  8.   [Address4],
  9.   [Work],
  10.   [Home],
  11.   [Cell],
  12.   [Plastic Number],
  13.   [ID Number],
  14.   [Cardholder ID],
  15.   [Company],
  16.   [CardType],
  17.   Delivery_Method,
  18.   [Cardholder Proof of Residence]
  19.   )
  20. Select r.Main_Link,
  21.        r.ClientName,
  22.        CCDCommon.dbo.DateOnly(Getdate()),
  23.        'Wealth',
  24.         r.Address1,
  25.         r.Address2,
  26.         r.Address3,
  27.         r.Address4,
  28.         r.Work,
  29.         r.Home,
  30.         r.Cell,
  31.         r.UniqueRef,
  32.         r.ClientIDNumber,
  33.         cast(r.Branch as nvarchar(500)),
  34.         r.CardType,
  35.         r.[Type],
  36.         case when  r.IDIndicator = 'Y' then 1 else 0            end,
  37.         case when  r.PORIndicator = 'Y' then 1 else 0            end
  38.             From Bidvest.dbo.[ImportData_Wealth] r left join [Bidvest Database]  d 
  39. on cast(r.[Main_Link] as nvarchar(250))= cast(d.[Item]as nvarchar(250))left join CCDArchive.dbo.[BidvestDatabase] a on a.[Plastic Number] = r.CardRef 
  40. and a.Type = 'Wealth'
  41. Where r.CardType = 'Electron Card'
  42. and r.[ImportDate] is null 
  43. and d.Item is null
  44. and a.Item is null
  45.  
  46. but I get the below error:
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the nvarchar value 'RMB PRIVATE BANK JOHANNESBURG - JHB' to data type bit.
Oct 18 '13 #1
1 4010
Sorry I'm sorted now.
Oct 18 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Saso Zagoranski | last post by:
Hi! I have created an SqlCommand object and I have set some parameters to it... One of the parameters is of the DateTime type; here is the code: sqlCommand.Parameters.Value =...
1
by: Sebastian Mark | last post by:
Did anyone got error like that? When I'm trying to Update WebReference in my project this is an error I'm getting "Custom tool error: Failed to generate dataset. Undefined data type:...
4
by: darrel | last post by:
I'm getting this error: Arithmetic overflow error converting numeric to data type numeric. Triggered on this line of my code: objOleDbAdapter.Fill(DS, "rss") Everything works when this is...
1
by: sonata | last post by:
I am trying to compare two fields which are char data typr. BUT the comparision must be arithemetic in nature. so i tried to cast both the data base field and my parameter field to big int...
2
by: Hulikal | last post by:
Hi, I using the following query select dateadd(s, 1185255439727, '01-01-1970 05:30:00') on MSSQL 2005. I get the error Arithmetic overflow error converting expression to data type...
2
by: bipinskulkarni | last post by:
Hi, i have a field createdby with datatype GUID. In following query ,i encountered with the error "Conversion failed when converting from a character string to uniqueidentifier" select...
9
by: gggram2000 | last post by:
I need some help, cant figure out the error. SqlConnection dbConnection = new SqlConnection(xmldb); dbConnection.Open(); string sql = "SELECT InvStatus FROM SaleReceipts Where AccNum = '" +...
5
by: Joell | last post by:
When I try to insert values into an existing table, I am getting the following error. The table is not in bit data type format and neither is the target table. Conversion failed when converting the...
1
by: vertigo262 | last post by:
This is driving me crazy I run this query in the sql management studio and it works fine. but seems like it doesn't work in the stored procedure Can I not use a LIKE '%' in an integer field? ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.