Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Problems dealing with Boolean data types(SQL).

$
0
0

Greetings.

Below is an sql code i am trying to execute.

select Band, Memb_contact =
CASE 
when contact_person >= 0 then 'Yes'
else 'No' 
end, Club_Name, Club_contact
from Members, Club
where contact_person = 'Yes'

My column contact_person has a data type of boolean. It stores 1 and -1 only.
I'm am trying to execute the select statement to return The Band Name and contact number only if the person

is identified as a contact person in the members table.

It return the following error:

Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value 'Yes' to data type bit.

Please help.



Viewing all articles
Browse latest Browse all 7129

Trending Articles



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