This is what I would like to do:
case p.residency_status
when 0 then
dbo.fn_formatAddress(r1.prm_name, p.py_hospital, p.py_address1, p.py_city, p.pyear_state)
when 1 then
dbo.fn_formatAddress(r1.prm_name, p.respgm_hospital, p.respgm_address1, p.respgm_city, p.respgm_state)
when 2 then
dbo.fn_formatAddress(r1.prm_name, p.curr_hospital, p.curr_address1, curr.city, p.curr_state)
end
Is there any way to do this? Essentially, based on residency_status, I will need to pass different parameters to a function.