Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Conversion failed when converting the varchar value 'No' to data type int.

$
0
0

Hi,

The problem that i am having is as follow:

i have a table called Results, and in this is a few rows

ReultID INT
QuestionID INT
ResultScore Varchar(10)

now there are 2 types of questions ones that can be added up for a total "QuestionAdd = 1" and ones that cant be added up towards the totals "QuestionAdd = 0". i have managed to pull through the data in every other view and procedure but one of them is giving me alot of hassle.

What i have done is create a view "qryResults" that has filtered out all the "QuestionAdd= 0" and summed them up so i get the totals for each user "TotalScore" ( this column as been converted into a INT from a varchar so that it can be added up) this query is now saved as a view "qrySectionscore" and it executes fine( 12273 rows are returned.).

This is where the problem comes in, when i then open up qrySectionScore and run a filter against it (only the userid) it throws an error saying that it "Conversion failed when converting the varchar value 'No' to data type int." but there is no value of that in this table because there is only the TotalScore which is an int and only contains numbers, i think it is being pulled through from the results table a few views back.

all this worked before until i redesigned the user table but i cant see that having any issue with this table.

please help????? 

(im able to provide more details if needed but i thought i would try and give a brief description)

Thanks.


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>