Hi,
I'm trying to create a view that shows columns based on user access level. I would like to be able to test for different values without having to add a REPLACE command for each value.
For example,
My UserLevelID can be 1, 2, 3, 4 or 5. 5 is an Officer level so I have the following command:
REPLACE
(m.UserLevelID, 5, 'Yes'') AS 'Officer',The problem is that I want the field to be blank for this column if the value is 1, 2, 3 or 4. I've tried the following, but none work.
REPLACE(REPLACE
(m.UserLevelID, 5, 'Yes''), IN(1,2,3,4), '') AS 'Officer'REPLACE(REPLACE(m.UserLevelID, 5, 'Yes''), NOT 5, '') AS 'Officer'
REPLACE(REPLACE(m.UserLevelID, 5, 'Yes''), < 5, '') AS 'Officer'
Any suggestions I know I can add a REPLACE function five times, but I have a few more uses for this so I would like to find the easiest method.Thanks,
Lee