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

Error converting data type varchar to float

I have created a stored procedure that contain this field (below) in
order to meet certain criteria. But my problem is when I try to run
the stored procedure I encounter an error "Error converting data type
varchar to float".

CASE Final WHEN 0 THEN '--' ELSE Final END AS FinalGrade

The Final field is a float data type.

Could anyone teach me how to fix this problem?
Jul 23 '05 #1
1 26912
Hi JayPee

You case statement is illegal because '--' is actually a varchar.
what do you want the return to be ? what is the function.

you could cast final as varchar and then return something like

when '0' then '--' else cast(final as varchar)

or if you need to keep it as float, i suggest putting null instead of
'--' and then running is_null on that.

hope this helps
Tzvika

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jay | last post by:
I hope this is the correct place to post this. I'm using a stored procedure to simply look up and return a value from a database. The db key is an integer, everything else is varchar. The stored...
4
by: Viktor Popov | last post by:
Hi, I'm trying to execute stored procedure and I collect its parameters from WebForm. There is an error: Error converting data type varchar to int. What could be the problem? Here it is the...
1
by: luna | last post by:
got so far then it broke and i cant get it working again - it was updating fine but not inserting and now im getting a "Error converting data type varchar to numeric" which i didnt have before.......
0
by: hjuler | last post by:
Hello, I have a job for a customer, to find out why the following query fails, and i can't really find any reason. The customer migrated from MSDE (Sql 2000) and after that the following query...
3
by: othellomy | last post by:
select convert(float,'1.2334e+006') 1233400.0 select convert(decimal(20,2),'1.2334e+006') Server: Msg 8114, Level 16, State 5, Line 1 Error converting data type varchar to numeric. can I set...
0
by: David | last post by:
This is a .net 1.1 question. I am attempting to load and process an XML file (see below) with XmlDocument. I can load the file: XmlDocument doc = new XmlDocument(); doc.Load("dump.xml"); ...
0
by: jjtechy | last post by:
The data like 0.06234 that is imported from another server is getting changed as 6.234....E-2 in my local.it is looking as 0.06234 in that server.The datatype of that column is varchar(50) in both...
1
by: codedhacker | last post by:
I have a piece of code that uses the db-library with sql server 2000/2005 and runs the following delete statement: DELETE FROM TABLE1 WHERE COL1 IN( 'Some Val1' ) AND COL2 IN( 'Some Val2' )...
3
by: lornab | last post by:
Hi I wonder if anyone can help - I think the answer is simple but it's been a really long day and I need to get this done!! My select statement goes like this... SELECT client, ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.