Reputation: 91
CASE
WHEN VPN_Access__c = True THEN 'Need to Setup' + VPN_Access__c
ELSE ''
END AS VPNAccessDesc`
I'm trying to create a Case statement but I keep getting an error stating invalid column name 'True'. It's a checkbox field and I want it to say "Need to Setup" if the table equals True.
VPN_Access__c
is a bit
datatype if that makes a difference
Upvotes: 2
Views: 10053
Reputation: 48547
Sql Server doesn't have boolean
values, so you'll need to do:
CASE WHEN VPN_Access__c = 1 THEN 'Need to Setup'
ELSE '' END AS VPNAccessDesc
Actually - you can remove + VPN_Access__c
as it makes more sense to say Need to Setup
rather than Need to Setup1
Upvotes: 5
Reputation: 11478
I'm not sure which database you're using, but in mysql5, BIT isn't the same as BOOLEAN, it's a bit field, you can't reliably compare it to true/false
Upvotes: 0