Hi
I have the below query setup
My problem is with the ACCOUNTLOCKED field, this is a data field containig 1 or 0, I would rather have this display text as would want to change the field to 'Account Status' and have 'Disabled' if ACCOUNTLOCKED = 1 Else 'Active' but am struggling, I tried to insert the below formula which I thought might do the job but can't get it to work either, maybe putting it in wrong place.
Any assistance on this would be greatly appreciated, as I am a newby to SQL queries who is having to pick it up as he goes along
(for Info I created a report in Crystal Reports and pasted the SQL query code from that into my SQL database which is why the code may be a bit different from usual SQL).
Thanks
I have the below query setup
Code:
SELECT "USERX"."UserX" as "User Name", "USERX"."Login_name" as "Login ID", "GroupX"."GroupX" as "Group","USERX"."ACCOUNTLOCKED" as "Account Disabled"
FROM "premise"."dbo"."USERX" "USERX" INNER JOIN "premise"."dbo"."GroupX" "GroupX" ON "USERX"."GroupRef"="GroupX"."GroupRef"
ORDER BY "USERX"."Login_name"
My problem is with the ACCOUNTLOCKED field, this is a data field containig 1 or 0, I would rather have this display text as would want to change the field to 'Account Status' and have 'Disabled' if ACCOUNTLOCKED = 1 Else 'Active' but am struggling, I tried to insert the below formula which I thought might do the job but can't get it to work either, maybe putting it in wrong place.
Code:
ACCOUNTLOCKED = CASE WHEN ACCOUNTLOCKED = 1 THEN 'Disabled' ELSE 'Active' END
Any assistance on this would be greatly appreciated, as I am a newby to SQL queries who is having to pick it up as he goes along
(for Info I created a report in Crystal Reports and pasted the SQL query code from that into my SQL database which is why the code may be a bit different from usual SQL).
Thanks