TSQL function to retrieve multiple values
Posted on 2016-08-24
Uh oh! SQL guy is on vacation again!
I'm trying to feed a "Race" field on an RDLC report. My database has a person table with bit fields to indicate the race(s) a person belongs to.
The layout is something like this:
person_ID | name | DOB | IsAsian | IsBlack | IsNativeHawaiian | IsAlaskaNative | IsWhite
A person can belong to more than one race group. I'm trying to write a function that would output a string of each race the person belongs to. For example, if IsAlaskaNative='1' AND IsWhite='1' the output would be "Alaskan Native, White".
Any help you can provide will be greatly appreciated.