troubleshooting Question

TSQL function to retrieve multiple values

Avatar of ttist25
ttist25 asked on
Microsoft SQL ServerMicrosoft SQL Server 2008
6 Comments4 Solutions119 ViewsLast Modified:

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.  
Join our community to see this answer!
Unlock 4 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros