To all
I inherited the following IIF query but it seems that there is a limitation as to how many access can handle. I would like to move the code to a Case select statement. Can someone help with the proper syntax? The code is the following:
if(a.[Hospital Currently Admitted to] Like '*STATEN*', 'Staten Island University Hospital',
if(a.[Hospital Currently Admitted to] Like '*BRONX*', 'Bronx-Lebanon Hospital Center',
if(a.[Hospital Currently Admitted to] Like '*ST*FRANC*', 'St Francis of Roslyn',
if(a.[Hospital Currently Admitted to] Like '*CORN*', 'NY Cornell',
if(a.[Hospital Currently Admitted to] Like '*HOSP*SPEC*S*', 'Hospital for Special Surgery',
if(a.[Hospital Currently Admitted to] Like '*HOSP*JT*D*', 'Hospital for Joint Diseases',
if(a.[Hospital Currently Admitted to] Like '*NYU*', 'NYU Medical Center',
if(a.[Hospital Currently Admitted to] Like '*SLOAN*', 'Memorial Sloan Kettering',
if(a.[Hospital Currently Admitted to] Like '*WESTCHESTER*', 'Westchester Square Med Center',
if(a.[Hospital Currently Admitted to] Like 'NY HOSP*Q*', 'New York Hospital Queens',
if(a.[Hospital Currently Admitted to] Like 'NY*PRESB*CP*', 'NYPH-Columbia',
if(a.[Hospital Currently Admitted to] Like 'NY*PRESB*A*', 'NYPH-Allan Pavilion',
if(a.[Hospital Currently Admitted to] Like 'MT*SINAI*H*', 'Mt Sinai Hospital',
if(a.[Hospital Currently Admitted to] Like '*METHODIST*', 'Methodist')))))))))))))) AS Hospital
Thanks in advance
I inherited the following IIF query but it seems that there is a limitation as to how many access can handle. I would like to move the code to a Case select statement. Can someone help with the proper syntax? The code is the following:
if(a.[Hospital Currently Admitted to] Like '*STATEN*', 'Staten Island University Hospital',
if(a.[Hospital Currently Admitted to] Like '*BRONX*', 'Bronx-Lebanon Hospital Center',
if(a.[Hospital Currently Admitted to] Like '*ST*FRANC*', 'St Francis of Roslyn',
if(a.[Hospital Currently Admitted to] Like '*CORN*', 'NY Cornell',
if(a.[Hospital Currently Admitted to] Like '*HOSP*SPEC*S*', 'Hospital for Special Surgery',
if(a.[Hospital Currently Admitted to] Like '*HOSP*JT*D*', 'Hospital for Joint Diseases',
if(a.[Hospital Currently Admitted to] Like '*NYU*', 'NYU Medical Center',
if(a.[Hospital Currently Admitted to] Like '*SLOAN*', 'Memorial Sloan Kettering',
if(a.[Hospital Currently Admitted to] Like '*WESTCHESTER*', 'Westchester Square Med Center',
if(a.[Hospital Currently Admitted to] Like 'NY HOSP*Q*', 'New York Hospital Queens',
if(a.[Hospital Currently Admitted to] Like 'NY*PRESB*CP*', 'NYPH-Columbia',
if(a.[Hospital Currently Admitted to] Like 'NY*PRESB*A*', 'NYPH-Allan Pavilion',
if(a.[Hospital Currently Admitted to] Like 'MT*SINAI*H*', 'Mt Sinai Hospital',
if(a.[Hospital Currently Admitted to] Like '*METHODIST*', 'Methodist')))))))))))))) AS Hospital
Thanks in advance