473,322 Members | 1,504 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,322 software developers and data experts.

data conversion

hi guys i have an sql query that alters a view by changing the data type of a column from varchar to int but keeps giving me this error "Conversion failed when converting the varchar value 'File N' to data type int." here is the sql query
Expand|Select|Wrap|Line Numbers
  1. ALTER VIEW V_IMPORT_RECORDS
  2. AS 
  3. SELECT
  4. case when cast(left(right(IMPORT_RECORDS.whichfile,44),6)as integer) = '010182' then 'RD100'
  5. when cast(left(right(IMPORT_RECORDS.whichfile,44),6)as integer) = '010181' then 'RD99' else 0 end as 'MachineName'
  6. FROM Import_Records
May 7 '14 #1
1 1186
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code or formatted data.

You are getting that error because you are trying to convert the string 'File N' to a number, which is impossible.
May 7 '14 #2

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

Similar topics

12
by: Dillon Mantle | last post by:
HI All Does any one know how to convert a binary file into a readable (by human) file? Its from a bin file, has addresses and stuff which I can work out... but how do you do the actual...
1
by: Tim | last post by:
I am researching a potential solution for my company. Currently we convert a new client's dataset into our own data structures using Fox Pro and then Sql (Our data is in SQL). There are a lot of...
6
by: New MSSQL DBA | last post by:
Hi all, we are now planning to upgrade our application from a non-unicode version to a unicode version. The application's backend is a SQL Server 2000 SP3. The concern is, existing business...
6
by: Ecohouse | last post by:
I have a field in a recordset which is a string. It can look like this: 13-15-67-56 I need to break out this string into numbers to run in queries to open recordsets. But when I try to open...
0
by: SerbianEagle | last post by:
Hello. I've just joined this forum as I've been searching for some advice with a data conversion that I have to do. Using : MS SQL server 2000 Old DB: many tables and no relationships...
0
by: ipoxygen | last post by:
Hi, I do have 6 identical tables on six different databases (same server). I would like to merge them into one single table for reporting purposes. For the majority of the table it does work...
7
by: girl | last post by:
Hi i have a problem with MS SQL server 2000 and hope to seek for some advise. i have the following samples aa|0|abcdefg| b|0|abcdefg| i used the bulk insert in the query analyser.. BULK...
1
by: Javilen | last post by:
Hello, edit: added some more info I am trying to set up a job to run a SSIS package in SQL 2005, the SQL 2005 is installed on a Windows server 2003 machine. start Edit I have the...
0
by: dataentryoffshore | last post by:
Get a Discount up to 60% on data entry, data capture, dataentry services, large volume data processing and data conversion services through offshore facilities in India. Offshore data entry also...
2
by: dowlingm815 | last post by:
Hi, In the following code, i keep getting a data conversion error at the fund field. In the code below, it takes data from a query and creates a table. It is a six digit alpha field within the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.