E
EManning
Using A2K and SQL2000
I have an sp that formats a doctor's name and their specialty like so:
John Doe (Radiology)
I need to be able to abbreviate the specialty. Radiology would be '(Rad)',
Anesthesiology would be '(A)', and so on. Since I have other sp's that
format the name this way and the specialty list is very long, I'd like to be
able to pass the specialty to another sp or function and return the
abbreviation.
Since I'm using an adp, I take it I can't use a user-defined function.
Could I accomplish this by passing the specialty another sp and returning
the abbreviation? What would the syntax be for doing this?
Here's a snippet of one of the stored procedures that formats the name.
Thanks for any help or advice.
SELECT tblDemographics.LastName + ', ' + tblDemographics.FirstName +
case
when tblDemographics.ResidencyTrack = 'Anesthesiology' then ' (A)'
when tblDemographics.ResidencyTrack = 'Radiology' then ' (R)'
else ' ' + '(' + tblDemographics.ResidencyTrack + ')'
end as ResidentName
I have an sp that formats a doctor's name and their specialty like so:
John Doe (Radiology)
I need to be able to abbreviate the specialty. Radiology would be '(Rad)',
Anesthesiology would be '(A)', and so on. Since I have other sp's that
format the name this way and the specialty list is very long, I'd like to be
able to pass the specialty to another sp or function and return the
abbreviation.
Since I'm using an adp, I take it I can't use a user-defined function.
Could I accomplish this by passing the specialty another sp and returning
the abbreviation? What would the syntax be for doing this?
Here's a snippet of one of the stored procedures that formats the name.
Thanks for any help or advice.
SELECT tblDemographics.LastName + ', ' + tblDemographics.FirstName +
case
when tblDemographics.ResidencyTrack = 'Anesthesiology' then ' (A)'
when tblDemographics.ResidencyTrack = 'Radiology' then ' (R)'
else ' ' + '(' + tblDemographics.ResidencyTrack + ')'
end as ResidentName