Link to home
Start Free TrialLog in
Avatar of zachvaldez
zachvaldezFlag for United States of America

asked on

What is data type equivalent for yes/no in MSSQL?

IN access you can set the ddata type to Y/N. What is the setting in MSSQL/ thanks
Avatar of William Elliott
William Elliott
Flag of United States of America image

bit =   Integer data with either a 1 or 0 value  

SELECT CASE WHEN ColA = ColB THEN 1 ELSE 0 END as myBit
FROM ...
Keep in mind, depending on how you set up DDL, a bit could be 1, 0 or NULL, not just 1 or 0. NULL doesn't equal anything, not even another null, so your comaprison code should always test for a true condition and set to false if not true.
SOLUTION
Avatar of PaultheBroker
PaultheBroker
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial