Mar 13, 2006 #1 Rob7412 Technical User Jan 26, 2006 31 US I have a db with three field ptfname,ptmint,ptlastname Is there any way to select these three fields as a alias such as patientname with the fields formated like this Smith, John T
I have a db with three field ptfname,ptmint,ptlastname Is there any way to select these three fields as a alias such as patientname with the fields formated like this Smith, John T
Mar 13, 2006 1 #2 gmmastros Programmer Feb 15, 2005 14,909 US Code: Select IsNull(ptLastName, '') + ', ' + IsNull(pfFName, '') + ' ' + IsNull(ptMInt, '') As PatientName From Table -George Strong and bitter words indicate a weak cause. - Fortune cookie wisdom Upvote 0 Downvote
Code: Select IsNull(ptLastName, '') + ', ' + IsNull(pfFName, '') + ' ' + IsNull(ptMInt, '') As PatientName From Table -George Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
Mar 13, 2006 1 #3 SQLDenis Programmer Oct 1, 2005 5,575 US one way select ptlastname + ', ' + ptfname + ' ' + coalesce(ptmint,'') as patientsname from table......... Denis The SQL Menace SQL blog:http://sqlservercode.blogspot.com/ Personal Blog:http://otherthingsnow.blogspot.com/ Upvote 0 Downvote
one way select ptlastname + ', ' + ptfname + ' ' + coalesce(ptmint,'') as patientsname from table......... Denis The SQL Menace SQL blog:http://sqlservercode.blogspot.com/ Personal Blog:http://otherthingsnow.blogspot.com/
Mar 13, 2006 Thread starter #4 Rob7412 Technical User Jan 26, 2006 31 US Thanks it's just what I needed Upvote 0 Downvote