Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9117037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:48:52+00:00 2026-06-17T04:48:52+00:00

I have the following code. The purpose is to take the data in the

  • 0

I have the following code. The purpose is to take the data in the field AML_TYP_CD which is the level of education they finished. 20 and 25 are the same as is 30/35/ 40/45 and I need to write a case statement that counts them up together so a 25 would return as 20 etc, and then there are about 50 other codes for the level of education that i need to elimnate. What is the best way to do this because the CASE statements i am writing does not work. The CASE statement will go in the SELECT clause, The one I wrote that doesnt work was

CASE WHEN (AML_TYP_CD) = '20' OR '25' THEN Bachelors ELSE NULL END) As Bach_Degree

The rest of the code is:

    SELECT     dbo.TACCPLI.SYS_EMP_ID_NR, MAX(dbo.TACCPLI.AML_TYP_CD) AS DEG
FROM         dbo.TACCPLI INNER JOIN
                          (SELECT     dbo.v_TMS_employee_HR.GEMSID, dbo.v_TMS_employee_HR.TMS_ID
                            FROM          dbo.v_TMS_employee_HR INNER JOIN
                                                   dbo.v_sc17_TMS_Data_Career_Meeting_Rating ON 
                                                   dbo.v_TMS_employee_HR.TMS_ID = dbo.v_sc17_TMS_Data_Career_Meeting_Rating.Employee_ID
                            WHERE      (LEFT(dbo.v_sc17_TMS_Data_Career_Meeting_Rating.Meeting_Readiness_Rating, 2) IN ('14', '15')) AND 
                                                   (dbo.v_TMS_employee_HR.Job_Group_Code >= '72') AND (dbo.v_TMS_employee_HR.Job_Group_Code <= '79') AND 
                                                   (dbo.v_sc17_TMS_Data_Career_Meeting_Rating.Plan_Year = 2012) AND (dbo.v_TMS_employee_HR.Region NOT IN ('12', '13', '16', '17'))
                            GROUP BY dbo.v_sc17_TMS_Data_Career_Meeting_Rating.Meeting_Readiness_Rating, dbo.v_TMS_employee_HR.GEMSID, dbo.v_TMS_employee_HR.TMS_ID) 
                      AS HPS ON dbo.TACCPLI.SYS_EMP_ID_NR = HPS.TMS_ID
GROUP BY dbo.TACCPLI.SYS_EMP_ID_NR
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:48:53+00:00Added an answer on June 17, 2026 at 4:48 am

    Your syntax is wrong. You’re going to want something like:

    SELECT 
        CASE WHEN AML_TYP_CD = '20' OR AML_TYP_CD = '25' THEN 'Bachelor''s' 
             WHEN AML_TYP_CD = '30' OR AML_TYP_CD = '35' THEN 'Whatever'
             --Other cases
             WHEN AML_TYP_CD = '90' OR AML_TYP_CD = '95' THEN 'Something'
             ELSE 'Other'
        END AS Degree
    

    Or a little cleaner in my opinion:

    SELECT 
        CASE WHEN CONVERT(INT, AML_TYP_CD) < 30 THEN 'Bachelor''s' 
             WHEN CONVERT(INT, AML_TYP_CD) < 40 THEN 'Whatever'
             --Other cases
             WHEN CONVERT(INT, AML_TYP_CD) < 100 THEN 'Something'
             ELSE 'Other'
        END AS Degree
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which needs the data to be read from port
I have following code for inserting data into database using PDO. It inserts data
I have following code: def whatever(url, data=None): req = urllib2.Request(url) res = urllib2.urlopen(req, data)
i have the following code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using
let's take the following code: class const_int { public: constexpr const_int(int data) : data_(data)
I have the following code for google maps. The purpose of this code is
I have some code written by someone else in which some functions take arguments
I have following code. The query take some 30 seconds to execute. I found
I have the following code to send users a verification email, which contains some
I have the following code which is designed to create an onchange event handler

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.