Solved

organize big query to meaning format

Posted on 2014-03-10
11
283 Views
Last Modified: 2014-03-13
can i make SSMS make a big unformatted query into a nicely formatted query to understand it better?
0
Comment
Question by:25112
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 5

Author Comment

by:25112
Comment Utility
here is an example what i have in mind..
example.txt
0
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 168 total points
Comment Utility
Holy cr&p.

Here's a couple of points.
Lose all the double-quotes.  The only time you'll need them, or square brackets [ ], is if the name doesn't follow standard naming conventions, usually if it has a space / character other than underscore.  "Do" "you" "get" my "point"?
Learn to indent with a tab.  Tab once all rows between SELECT and FROM, again for all of a CASE's WHEN..THEN blocks, between FROM and all JOINs (especially subqueries), you get the idea.

Looking at the query I have no idea where the WHERE clause is, and it's hard to navigate all the FROM's with the subquery.  Indenting makes it MUCH easier to read.
Each JOIN starts on it's own line, properly indented.
Use table aliases, so the tables are easier to understand.  
Reason #1 - No Freaking idea what KXos1, KXOS_3 means, and neither will the poor sucker that inherits this code.  Office and Evaluation_Category I get.
Reason #2 - ec takes up less space then Evaluation_Category, and if I have to see the table referred to 42 times it's easier to see ea.
In this --> = {d '2014-02-02'} <--, what's the purpose of the { } and d?
0
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 168 total points
Comment Utility
>can i make SSMS make a big unformatted query into a nicely formatted query to understand it better?
Also, if your question is 'Is there a magic button to push in SSMS that will make any pile of T-SQL nicely formatted', then the answer is no.   There may be some third-party tools such as RedGate that can help, but I'm guessing it'll be minimal.
0
 
LVL 45

Assisted Solution

by:aikimark
aikimark earned 166 total points
Comment Utility
Pasting your SQL text into http://www.dpriver.com/pp/sqlformat.htm
produced the following.
SELECT "KXos1"."office_code"                              AS "Office_Code",
       "KXos1"."office_name"                              AS "Office_Name",
       "KXos1"."kxos_3_served"                            AS "KXos_3_Served",
       "KXos1"."employee_id"                              AS "Employee_ID",
       "KXos1"."c5"                                       AS "c5",
       "KXos1"."passed"                                   AS "Passed",
       "KXos1"."c7"                                       AS "c7",
       "Evaluation_Previous_Year_2"."attained_level_code" AS "c8",
       CASE
         WHEN NOT "KXos1"."c7" IS NULL THEN
           CASE
             WHEN Cast("KXos1"."c5" AS REAL) - Cast("KXos1"."c7" AS REAL) >= .6
           THEN 1
             ELSE 0
           END
         WHEN NOT "Evaluation_Previous_Year_2"."attained_level_code" IS NULL
       THEN
           CASE
             WHEN Cast("KXos1"."c5" AS REAL) - Cast(
                         "Evaluation_Previous_Year_2"."attained_level_code" AS
                         REAL) >=
                  .6
           THEN 1
             ELSE 0
           END
         ELSE 0
       END                                                AS "Growth",
       CASE
         WHEN "KXos1"."passed" = 0
              AND CASE
                    WHEN NOT "KXos1"."c7" IS NULL THEN
                      CASE
                        WHEN ( Cast("KXos1"."c5" AS REAL) - Cast(
                               "KXos1"."c7" AS REAL)
                               >= .6 )
                      THEN 1
                        ELSE 0
                      END
                    WHEN NOT "Evaluation_Previous_Year_2"."attained_level_code"
                             IS NULL
                  THEN
                      CASE
                        WHEN ( Cast("KXos1"."c5" AS REAL) - Cast(
       "Evaluation_Previous_Year_2"."attained_level_code" AS
       REAL
                           ) >=
       .6 ) THEN 1
       ELSE 0
       END
       ELSE 0
       END = 0 THEN 1
         ELSE 0
       END                                                AS "No_Up"
FROM   (SELECT "KXos3_Assess_CurrentYear"."office_code"           AS
               "Office_Code",
               "KXos3_Assess_CurrentYear"."office_name"           AS
               "Office_Name",
               "KXos3_Assess_CurrentYear"."kxos_3_served"         AS
               "KXos_3_Served",
               "KXos3_Assess_CurrentYear"."employee_id"           AS
               "Employee_ID",
               "KXos3_Assess_CurrentYear"."c5"                    AS "c5",
               "KXos3_Assess_CurrentYear"."passed"                AS "Passed",
               "Evaluation_Previous_Year_1"."attained_level_code" AS "c7"
        FROM   (SELECT DISTINCT "KXos_3_Final"."office_code"
                                AS
                                        "Office_Code",
                                "KXos_3_Final"."office_name"
                                AS
                                        "Office_Name",
                                "KXos_3_Final"."employee_id"
                                AS
                                        "Employee_ID",
                                "KXos_3_Final"."kxos_3_served"
                                AS
                                        "KXos_3_Served",
                                "Evaluation_Current_Year"."attained_level_code"
                                AS "c5"
                                ,
                                CASE
                                  WHEN
               "Evaluation_Current_Year"."attained_level_code"
               = 'NA'
                THEN 0
                                  WHEN
               "Evaluation_Current_Year"."attained_level_code"
               >= 4.5
                THEN 1
                                  ELSE 0
                                END
                                AS
                                "Passed"
                FROM   (SELECT DISTINCT "KXos_3"."office_code"            AS
                                        "Office_Code",
                                        "KXos_3"."office_name"            AS
                                        "Office_Name",
                                        "KXos_3"."premise_id"             AS
                                        "Premise_ID",
                                        "KXos_3"."full_premise_name"      AS
                                        "Full_Premise_Name",
                                        "KXos_3"."employee_id"            AS
                                        "Employee_ID",
                                        "KXos_3"."current_position_level" AS
                                        "Current_Position_Level",
                                        "KXos_3"."ethnicity"              AS
                                        "Ethnicity",
                                        "KXos_3"."ethnicity_code"         AS
                                        "Ethnicity_Code",
                                        "KXos_3"."employee_gender"        AS
                                        "Employee_Gender",
                                        "KXos_3"."employee_gender_code"   AS
                                        "Employee_Gender_Code",
                                        "KXos_3"."main_skill_code"        AS
                                        "Main_Skill_Code",
                                        "KXos_3"."mainskillcode"          AS
                                        "MainSkillCode",
                                        "KXos_3"."kxos_3_served"          AS
                                        "KXos_3_Served",
                                        "KXos_3"."current_pel"            AS
                                        "Current_PEL"
                        FROM   (SELECT "office"."office_code"
                                       AS
                                       "Office_Code",
                                       "office"."office_name"
                                       AS
                                       "Office_Name",
                                       "premise"."premise_id"
                                       AS
                                       "Premise_ID"
                                       ,
                                       "premise"."premise_name"
                                       AS "Full_Premise_Name",
                                       "Employee_Snapshot"."employee_id"
                                       AS
                                       "Employee_ID",
                                       "Employee_Snapshot"."curr_position_lvl"
                                       AS
                                       "Current_Position_Level",
                                       "Employee_Snapshot"."ethnic_desc"
                                       AS
                                       "Ethnicity",
                                       "Employee_Snapshot"."ethnic_code"
                                       AS
                                       "Ethnicity_Code",
                                       "Employee_Snapshot"."employee_gender"
                                       AS
                                       "Employee_Gender",
                                       "Employee_Snapshot"."employee_gender_cd"
                                       AS
                                       "Employee_Gender_Code",
                                       "Employee_Snapshot"."main_prim_skill"
                                       AS
                                       "Main_Skill_Code",
                                       "Employee_Snapshot"."mainskillcode"
                                       AS
                                       "MainSkillCode",
                                       1
                                       AS
                                       "KXos_3_Served",
                                       CASE
                                         WHEN
                               "Employee_Snapshot"."pel_part_code" IN (
                               '01',
                               '02' )
                                       THEN 'Y'
                                         ELSE 'N'
                                       END
                                       AS
                                       "Current_PEL",
                                       "Employee_Snapshot"."pel_duration"
                                       AS
                                       "LPP__Duration",
                                       "Employee_Snapshot"."pel_eligibility"
                                       AS
                                       "LPP__Eligibility",
                                       "Employee_Snapshot"."pel_eligibil_code"
                                       AS
                                       "LPP__Eligibility_Code",
                                       "Employee_Snapshot"."pel_part"
                                       AS
                                       "LPP__Participation"
                                       ,
                                       "Employee_Snapshot"."pel_part_code"
                                       AS
                                       "LPP__Participation_Code"
                                FROM   "RZAJ"."office" "Office",
                                       "RZAJ"."premise" "Premise",
                                       "RZAJ"."emp_snapshot" "Employee_Snapshot"
                                WHERE  Cast("Employee_Snapshot"."eval_date" AS
                                            DATE) =
                                       {d '2014-02-02'}
                                       AND Cast(
                               "Employee_Snapshot"."snapshot_date" AS
                               DATE) =
                                           {d '2014-02-02'}
                                       AND ( "office"."level_aggr" IN ( 'D1',
                                             'S1' )
                                              OR "premise"."org_type_code" =
                                                 'CC' )
                                       AND "Employee_Snapshot"."pel_part_code"
                                           IN
                                           ( '01', '02' )
                                       AND "Employee_Snapshot"."pel_eligibility"
                                           =
                                           'KXos 3Served'
                                       AND "office"."office_key" =
                                           "Employee_Snapshot"."office_key"
                                       AND "premise"."premise_key" =
                                           "Employee_Snapshot"."premise_key"
                                       AND ( "office"."office_code" = 4322 ))
                               "KXos_3")
                       "KXos_3_Final"
                       LEFT OUTER JOIN (SELECT DISTINCT "office"."office_code"
                                                        AS
                       "Office_Code"
                       ,
                       "office"."office_name"                            AS
                       "Office_Name",
                       "premise"."premise_id"                            AS
                       "Premise_ID",
                       "premise"."loc_short_name"                        AS
                       "Common_Premise_Name",
                       "Employee_Snapshot"."employee_id"                 AS
                       "Employee_ID",
                       "Evaluation_Attributes"."review_desc"             AS
                       "Evaluation_ID",
                       "Evaluation_Attributes"."version"                 AS
                       "Evaluation_EvalDate",
                       "Evaluation_Attributes"."review_desc_version"     AS
                       "Evaluation_ID_and_EvalDate",
                       "Evaluation_Attributes"."review_type"             AS
                       "Evaluation_Type",
                       "Evaluation_Attributes"."review_desc_long"        AS
                       "Evaluation_Name",
                       "Evaluation_Attributes"."review_group"            AS
                       "Evaluation_Group",
                       "Evaluation_Attributes"."review_category"         AS
                       "Evaluation_Category",
                       "Evaluation_Attributes"."review_vendor"           AS
                       "Evaluation_Vendor",
                       "Evaluation_Ctgy_Attributes"."point_desc"         AS
                       "Ctgy_Identifier",
                       "Evaluation_Ctgy_Attributes"."point_subject_area" AS
                       "Ctgy_Subject_Area_Code",
                       "Evaluation_Ctgy_Attributes"."point_item_type"    AS
                                                        "c16",
                       CASE
                       WHEN "Evaluation_Ctgy_Levels"."attain_code" = ' NA ' THEN
                       '0'
                       ELSE "Evaluation_Ctgy_Levels"."attain_code"
                       END                                               AS
                       "Attained_Level_Code",
                       "Employee_Snapshot"."pel_part_code"               AS
                       "LPP__Participation_Code",
                       "Employee_Snapshot"."pel_part"                    AS
                       "LPP__Participation",
                       CASE
                       WHEN "Evaluation_Ctgy_Levels"."attain_code" = ' NA ' THEN
                       '0'
                       WHEN Cast("Evaluation_Ctgy_Levels"."attain_code" AS REAL)
                            >
                       4.4 THEN '1'
                       ELSE '0'
                       END                                               AS
                       "Attainment"
                       FROM   "RZAJ"."office" "Office",
                       "RZAJ"."premise" "Premise",
                       "RZAJ"."emp_snapshot" "Employee_Snapshot",
                       "RZAJ"."evaluation_info" "Evaluation_Attributes",
                       "RZAJ"."evaluation_item" "Evaluation_Ctgy_Attributes",
                       "RZAJ"."evaluation_fact" "Evaluation_Ctgy_Levels"
                       WHERE  "Evaluation_Attributes"."review_desc" = 'PAELL'
                       AND "Evaluation_Ctgy_Levels"."eval_date" =
                           {d '2014-02-02'}
                       AND "Evaluation_Ctgy_Attributes"."point_subject_area" =
                           'Tender'
                       AND "Employee_Snapshot"."pel_part_code" IN ( '01', '02' )
                       AND "office"."office_key" =
                           "Evaluation_Ctgy_Levels"."office_key"
                       AND "Evaluation_Attributes"."review_key" =
                       "Evaluation_Ctgy_Levels"."review_key"
                       AND "premise"."premise_key" =
                           "Evaluation_Ctgy_Levels"."premise_key"
                       AND "Employee_Snapshot"."employee_key" =
                       "Evaluation_Ctgy_Levels"."employee_key"
                       AND "Evaluation_Ctgy_Attributes"."point_key" =
                       "Evaluation_Ctgy_Levels"."point_key"
                       AND ( "office"."office_code" = 4322 ))
                                       "Evaluation_Current_Year"
                                    ON "KXos_3_Final"."employee_id" =
                                       "Evaluation_Current_Year"."employee_id")
               "KXos3_Assess_CurrentYear"
               LEFT OUTER JOIN (SELECT DISTINCT
                               "office"."office_code"
                               AS
                               "Office_Code",
                                                "office"."office_name"
                                                          AS
                                                          "Office_Name"
                                                                          ,
                               "premise"."premise_id"
                               AS
                                                          "Premise_ID",
                               "premise"."loc_short_name"
                               AS
                                                          "Common_Premise_Name",
                               "Employee_Snapshot"."employee_id"
                               AS
                                                          "Employee_ID",
                               "Evaluation_Attributes"."review_desc"
                               AS
                                                          "Evaluation_ID",
                               "Evaluation_Attributes"."version"
                               AS
                                                          "Evaluation_EvalDate",
                               "Evaluation_Attributes"."review_desc_version"
                               AS
                               "Evaluation_ID_and_EvalDate"
                               ,
                               "Evaluation_Attributes"."review_type"
                               AS
                                                          "Evaluation_Type",
                               "Evaluation_Attributes"."review_desc_long"
                               AS
                                                          "Evaluation_Name",
                               "Evaluation_Attributes"."review_group"
                               AS
                                                          "Evaluation_Group",
                               "Evaluation_Attributes"."review_category"
                               AS
                                                          "Evaluation_Category",
                               "Evaluation_Attributes"."review_vendor"
                               AS
                                                          "Evaluation_Vendor",
                               "Evaluation_Ctgy_Attributes"."point_desc"
                               AS
                                                          "Ctgy_Identifier",
                               "Evaluation_Ctgy_Attributes"."point_subject_area"
                               AS
                               "Ctgy_Subject_Area_Code",
                               "Evaluation_Ctgy_Attributes"."point_item_type"
                               AS
                               "c16"
                               ,
                               CASE
                                 WHEN "Evaluation_Ctgy_Levels"."attain_code" =
                                      'NA'
                               THEN '0'
                                 ELSE "Evaluation_Ctgy_Levels"."attain_code"
                               END
                               AS
                                                          "Attained_Level_Code",
                               "Employee_Snapshot"."pel_part_code"
                               AS
                               "LPP__Participation_Code",
                               "Employee_Snapshot"."pel_part"
                               AS
                                                          "LPP__Participation"
                                FROM   "RZAJ"."office" "Office",
                                       "RZAJ"."premise" "Premise",
                                       "RZAJ"."emp_snapshot" "Employee_Snapshot"
                                       ,
               "RZAJ"."evaluation_info" "Evaluation_Attributes"
               ,
       "RZAJ"."evaluation_item" "Evaluation_Ctgy_Attributes",
       "RZAJ"."evaluation_fact" "Evaluation_Ctgy_Levels"
       WHERE  "Evaluation_Attributes"."review_desc" = 'PAELL'
       AND Dateadd(year, 1, Cast(
           "Evaluation_Ctgy_Levels"."eval_date" AS DATE))
           =
           {d '2014-02-02'}
       AND "Evaluation_Ctgy_Attributes"."point_subject_area" =
           'Tender'
       AND "Employee_Snapshot"."pel_part_code" IN
           ( '01', '02' )
       AND "office"."office_key" =
           "Evaluation_Ctgy_Levels"."office_key"
       AND "Evaluation_Attributes"."review_key" =
           "Evaluation_Ctgy_Levels"."review_key"
       AND "premise"."premise_key" =
           "Evaluation_Ctgy_Levels"."premise_key"
       AND "Employee_Snapshot"."employee_key" =
           "Evaluation_Ctgy_Levels"."employee_key"
       AND "Evaluation_Ctgy_Attributes"."point_key" =
           "Evaluation_Ctgy_Levels"."point_key"
       AND ( "office"."office_code" = 4322 ))
                          "Evaluation_Previous_Year_1"
       ON "KXos3_Assess_CurrentYear"."employee_id" =
       "Evaluation_Previous_Year_1"."employee_id") "KXos1"
       LEFT OUTER JOIN (SELECT DISTINCT "office"."office_code"
                                        AS
       "Office_Code"
       ,
       "office"."office_name"                            AS
       "Office_Name",
       "premise"."premise_id"                            AS
       "Premise_ID",
       "premise"."loc_short_name"                        AS
       "Common_Premise_Name",
       "Employee_Snapshot"."employee_id"                 AS
       "Employee_ID",
       "Evaluation_Attributes"."review_desc"             AS
       "Evaluation_ID",
       "Evaluation_Attributes"."version"                 AS
       "Evaluation_EvalDate",
       "Evaluation_Attributes"."review_desc_version"     AS
       "Evaluation_ID_and_EvalDate",
       "Evaluation_Attributes"."review_type"             AS
       "Evaluation_Type",
       "Evaluation_Attributes"."review_desc_long"        AS
       "Evaluation_Name",
       "Evaluation_Attributes"."review_group"            AS
       "Evaluation_Group",
       "Evaluation_Attributes"."review_category"         AS
       "Evaluation_Category",
       "Evaluation_Attributes"."review_vendor"           AS
       "Evaluation_Vendor",
       "Evaluation_Ctgy_Attributes"."point_desc"         AS
       "Ctgy_Identifier",
       "Evaluation_Ctgy_Attributes"."point_subject_area" AS
       "Ctgy_Subject_Area_Code",
       "Evaluation_Ctgy_Attributes"."point_item_type"    AS "c16",
       CASE
       WHEN "Evaluation_Ctgy_Levels"."attain_code" = 'NA' THEN '0'
       ELSE "Evaluation_Ctgy_Levels"."attain_code"
       END                                               AS
       "Attained_Level_Code",
       "Employee_Snapshot"."pel_part_code"               AS
       "LPP__Participation_Code",
       "Employee_Snapshot"."pel_part"                    AS
       "LPP__Participation"
       FROM   "RZAJ"."office" "Office",
       "RZAJ"."premise" "Premise",
       "RZAJ"."emp_snapshot" "Employee_Snapshot",
       "RZAJ"."evaluation_info" "Evaluation_Attributes",
       "RZAJ"."evaluation_item" "Evaluation_Ctgy_Attributes",
       "RZAJ"."evaluation_fact" "Evaluation_Ctgy_Levels"
       WHERE  "Evaluation_Attributes"."review_desc" = 'PAELL'
       AND Dateadd(year, 2, Cast("Evaluation_Ctgy_Levels"."eval_date" AS DATE))
       =
       {d '2014-02-02'}
       AND "Evaluation_Ctgy_Attributes"."point_subject_area" = 'Tender'
       AND "Employee_Snapshot"."pel_part_code" IN ( '01', '02' )
       AND "office"."office_key" = "Evaluation_Ctgy_Levels"."office_key"
       AND "Evaluation_Attributes"."review_key" =
       "Evaluation_Ctgy_Levels"."review_key"
       AND "premise"."premise_key" = "Evaluation_Ctgy_Levels"."premise_key"
       AND "Employee_Snapshot"."employee_key" =
       "Evaluation_Ctgy_Levels"."employee_key"
       AND "Evaluation_Ctgy_Attributes"."point_key" =
       "Evaluation_Ctgy_Levels"."point_key"
       AND ( "office"."office_code" = 4322 )) "Evaluation_Previous_Year_2"
                    ON "KXos1"."employee_id" =
                       "Evaluation_Previous_Year_2"."employee_id" 

Open in new window

0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
If I first remove the quote characters, as recommended by Jim Horn, the result is:
SELECT KXos1.office_code                              AS Office_Code,
       KXos1.office_name                              AS Office_Name,
       KXos1.kxos_3_served                            AS KXos_3_Served,
       KXos1.employee_id                              AS Employee_ID,
       KXos1.c5                                       AS c5,
       KXos1.passed                                   AS Passed,
       KXos1.c7                                       AS c7,
       Evaluation_Previous_Year_2.attained_level_code AS c8,
       CASE
         WHEN NOT KXos1.c7 IS NULL THEN
           CASE
             WHEN Cast(KXos1.c5 AS REAL) - Cast(KXos1.c7 AS REAL) >= .6 THEN 1
             ELSE 0
           END
         WHEN NOT Evaluation_Previous_Year_2.attained_level_code IS NULL THEN
           CASE
             WHEN Cast(KXos1.c5 AS REAL) - Cast(
                  Evaluation_Previous_Year_2.attained_level_code AS
                         REAL) >= .6 THEN 1
             ELSE 0
           END
         ELSE 0
       END                                            AS Growth,
       CASE
         WHEN KXos1.passed = 0
              AND CASE
                    WHEN NOT KXos1.c7 IS NULL THEN
                      CASE
                        WHEN ( Cast(KXos1.c5 AS REAL) - Cast(KXos1.c7 AS REAL)
                               >= .6 )
                      THEN 1
                        ELSE 0
                      END
                    WHEN NOT Evaluation_Previous_Year_2.attained_level_code IS
                             NULL
                  THEN
                      CASE
                        WHEN ( Cast(KXos1.c5 AS REAL) - Cast(
                               Evaluation_Previous_Year_2.attained_level_code
                               AS
                                        REAL) >= .6 ) THEN 1
                        ELSE 0
                      END
                    ELSE 0
                  END = 0 THEN 1
         ELSE 0
       END                                            AS No_Up
FROM   (SELECT KXos3_Assess_CurrentYear.office_code           AS Office_Code,
               KXos3_Assess_CurrentYear.office_name           AS Office_Name,
               KXos3_Assess_CurrentYear.kxos_3_served         AS KXos_3_Served,
               KXos3_Assess_CurrentYear.employee_id           AS Employee_ID,
               KXos3_Assess_CurrentYear.c5                    AS c5,
               KXos3_Assess_CurrentYear.passed                AS Passed,
               Evaluation_Previous_Year_1.attained_level_code AS c7
        FROM   (SELECT DISTINCT KXos_3_Final.office_code                    AS
                                Office_Code,
                                KXos_3_Final.office_name                    AS
                                Office_Name,
                                KXos_3_Final.employee_id                    AS
                                Employee_ID,
                                KXos_3_Final.kxos_3_served                  AS
                                KXos_3_Served,
                                Evaluation_Current_Year.attained_level_code AS
                                c5,
                                CASE
                                  WHEN
               Evaluation_Current_Year.attained_level_code =
               'NA' THEN
                                  0
                                  WHEN
               Evaluation_Current_Year.attained_level_code >=
               4.5 THEN
                                  1
                                  ELSE 0
                                END                                         AS
                                Passed
                FROM   (SELECT DISTINCT KXos_3.office_code            AS
                                        Office_Code,
                                        KXos_3.office_name            AS
                                        Office_Name,
                                        KXos_3.premise_id             AS
                                        Premise_ID,
                                        KXos_3.full_premise_name      AS
                                        Full_Premise_Name,
                                        KXos_3.employee_id            AS
                                        Employee_ID,
                                        KXos_3.current_position_level AS
                                        Current_Position_Level
                                        ,
                                        KXos_3.ethnicity
                                        AS Ethnicity,
                                        KXos_3.ethnicity_code         AS
                                        Ethnicity_Code
                                        ,
       KXos_3.employee_gender        AS Employee_Gender,
       KXos_3.employee_gender_code   AS Employee_Gender_Code,
       KXos_3.main_skill_code        AS Main_Skill_Code,
       KXos_3.mainskillcode          AS MainSkillCode,
       KXos_3.kxos_3_served          AS KXos_3_Served,
       KXos_3.current_pel            AS Current_PEL
       FROM   (SELECT office.office_code                   AS Office_Code,
       office.office_name                   AS Office_Name,
       premise.premise_id                   AS Premise_ID,
       premise.premise_name                 AS
       Full_Premise_Name,
       Employee_Snapshot.employee_id        AS Employee_ID,
       Employee_Snapshot.curr_position_lvl  AS
       Current_Position_Level,
       Employee_Snapshot.ethnic_desc        AS Ethnicity,
       Employee_Snapshot.ethnic_code        AS Ethnicity_Code,
       Employee_Snapshot.employee_gender    AS Employee_Gender,
       Employee_Snapshot.employee_gender_cd AS
       Employee_Gender_Code,
       Employee_Snapshot.main_prim_skill    AS Main_Skill_Code,
       Employee_Snapshot.mainskillcode      AS MainSkillCode,
       1                                    AS KXos_3_Served,
       CASE
        WHEN Employee_Snapshot.pel_part_code IN ( '01', '02' )
       THEN
        'Y'
        ELSE 'N'
       END                                  AS Current_PEL,
       Employee_Snapshot.pel_duration       AS LPP__Duration,
       Employee_Snapshot.pel_eligibility    AS LPP__Eligibility
       ,
       Employee_Snapshot.pel_eligibil_code  AS LPP__Eligibility_Code,
       Employee_Snapshot.pel_part           AS LPP__Participation,
       Employee_Snapshot.pel_part_code      AS LPP__Participation_Code
       FROM   rzaj.office Office,
       rzaj.premise Premise,
       rzaj.emp_snapshot Employee_Snapshot
       WHERE  Cast(Employee_Snapshot.eval_date AS DATE) = {d '2014-02-02'}
       AND Cast(Employee_Snapshot.snapshot_date AS DATE) =
       {d '2014-02-02'}
       AND ( office.level_aggr IN ( 'D1', 'S1' )
       OR premise.org_type_code = 'CC' )
       AND Employee_Snapshot.pel_part_code IN ( '01', '02' )
       AND Employee_Snapshot.pel_eligibility = 'KXos 3Served'
       AND office.office_key = Employee_Snapshot.office_key
       AND premise.premise_key = Employee_Snapshot.premise_key
       AND ( office.office_code = 4322 )) KXos_3) KXos_3_Final
       LEFT OUTER JOIN (SELECT DISTINCT office.office_code
       AS Office_Code,
       office.office_name
       AS Office_Name,
       premise.premise_id
       AS Premise_ID,
       premise.loc_short_name
       AS
       Common_Premise_Name,
       Employee_Snapshot.employee_id
       AS Employee_ID,
       Evaluation_Attributes.review_desc
       AS Evaluation_ID,
       Evaluation_Attributes.version
       AS
       Evaluation_EvalDate,
       Evaluation_Attributes.review_desc_version
       AS
       Evaluation_ID_and_EvalDate,
       Evaluation_Attributes.review_type
       AS
       Evaluation_Type,
       Evaluation_Attributes.review_desc_long
       AS
       Evaluation_Name,
       Evaluation_Attributes.review_group
       AS
       Evaluation_Group,
       Evaluation_Attributes.review_category
       AS
       Evaluation_Category,
       Evaluation_Attributes.review_vendor
       AS
       Evaluation_Vendor,
       Evaluation_Ctgy_Attributes.point_desc
       AS
       Ctgy_Identifier,
       Evaluation_Ctgy_Attributes.point_subject_area
       AS
       Ctgy_Subject_Area_Code,
       Evaluation_Ctgy_Attributes.point_item_type
       AS c16,
       CASE
       WHEN Evaluation_Ctgy_Levels.attain_code =
       ' NA ' THEN '0'
       ELSE Evaluation_Ctgy_Levels.attain_code
       END
       AS
       Attained_Level_Code,
       Employee_Snapshot.pel_part_code
       AS
       LPP__Participation_Code,
       Employee_Snapshot.pel_part
       AS
       LPP__Participation,
       CASE
       WHEN Evaluation_Ctgy_Levels.attain_code =
       ' NA ' THEN '0'
       WHEN Cast(Evaluation_Ctgy_Levels.attain_code
           AS REAL) > 4.4
       THEN '1'
       ELSE '0'
       END
       AS Attainment
       FROM   rzaj.office Office,
       rzaj.premise Premise,
       rzaj.emp_snapshot Employee_Snapshot,
       rzaj.evaluation_info Evaluation_Attributes,
       rzaj.evaluation_item Evaluation_Ctgy_Attributes,
       rzaj.evaluation_fact Evaluation_Ctgy_Levels
       WHERE  Evaluation_Attributes.review_desc = 'PAELL'
       AND Evaluation_Ctgy_Levels.eval_date = {d '2014-02-02'}
       AND Evaluation_Ctgy_Attributes.point_subject_area =
       'Tender'
       AND Employee_Snapshot.pel_part_code IN ( '01', '02' )
       AND office.office_key =
       Evaluation_Ctgy_Levels.office_key
       AND Evaluation_Attributes.review_key =
       Evaluation_Ctgy_Levels.review_key
       AND premise.premise_key =
       Evaluation_Ctgy_Levels.premise_key
       AND Employee_Snapshot.employee_key =
       Evaluation_Ctgy_Levels.employee_key
       AND Evaluation_Ctgy_Attributes.point_key =
       Evaluation_Ctgy_Levels.point_key
       AND ( office.office_code = 4322 ))
       Evaluation_Current_Year
       ON KXos_3_Final.employee_id = Evaluation_Current_Year.employee_id)
       KXos3_Assess_CurrentYear
       LEFT OUTER JOIN (SELECT DISTINCT office.office_code
               AS Office_Code,
               office.office_name
                                        AS Office_Name,
               premise.premise_id
                                        AS Premise_ID,
               premise.loc_short_name
                                        AS
       Common_Premise_Name,
               Employee_Snapshot.employee_id
                                        AS Employee_ID,
               Evaluation_Attributes.review_desc
                                        AS Evaluation_ID,
               Evaluation_Attributes.version
                                        AS
       Evaluation_EvalDate,
               Evaluation_Attributes.review_desc_version
                                        AS
       Evaluation_ID_and_EvalDate,
               Evaluation_Attributes.review_type
                                        AS
       Evaluation_Type,
               Evaluation_Attributes.review_desc_long
                                        AS
       Evaluation_Name,
               Evaluation_Attributes.review_group
                                        AS
       Evaluation_Group,
               Evaluation_Attributes.review_category
                                        AS
       Evaluation_Category,
               Evaluation_Attributes.review_vendor
                                        AS
       Evaluation_Vendor,
               Evaluation_Ctgy_Attributes.point_desc
                                        AS
       Ctgy_Identifier,
               Evaluation_Ctgy_Attributes.point_subject_area
                                        AS
       Ctgy_Subject_Area_Code,
               Evaluation_Ctgy_Attributes.point_item_type
                                        AS c16,
               CASE
                 WHEN Evaluation_Ctgy_Levels.attain_code =
                      'NA' THEN '0'
                 ELSE Evaluation_Ctgy_Levels.attain_code
               END
                                        AS
       Attained_Level_Code,
               Employee_Snapshot.pel_part_code
                                        AS
       LPP__Participation_Code,
               Employee_Snapshot.pel_part
                                        AS
       LPP__Participation
       FROM   rzaj.office Office,
       rzaj.premise Premise,
       rzaj.emp_snapshot Employee_Snapshot,
       rzaj.evaluation_info Evaluation_Attributes,
       rzaj.evaluation_item Evaluation_Ctgy_Attributes,
       rzaj.evaluation_fact Evaluation_Ctgy_Levels
       WHERE  Evaluation_Attributes.review_desc = 'PAELL'
       AND Dateadd(year, 1, Cast(
          Evaluation_Ctgy_Levels.eval_date AS DATE)) =
          {d '2014-02-02'}
       AND Evaluation_Ctgy_Attributes.point_subject_area =
          'Tender'
       AND Employee_Snapshot.pel_part_code IN ( '01', '02' )
       AND office.office_key =
          Evaluation_Ctgy_Levels.office_key
       AND Evaluation_Attributes.review_key =
          Evaluation_Ctgy_Levels.review_key
       AND premise.premise_key =
          Evaluation_Ctgy_Levels.premise_key
       AND Employee_Snapshot.employee_key =
          Evaluation_Ctgy_Levels.employee_key
       AND Evaluation_Ctgy_Attributes.point_key =
          Evaluation_Ctgy_Levels.point_key
       AND ( office.office_code = 4322 ))
                       Evaluation_Previous_Year_1
       ON KXos3_Assess_CurrentYear.employee_id =
       Evaluation_Previous_Year_1.employee_id) KXos1
       LEFT OUTER JOIN (SELECT DISTINCT office.office_code
                                        AS Office_Code,
                                        office.office_name
                                                                     AS
                                        Office_Name,
                                        premise.premise_id
                                                                     AS
                                        Premise_ID,
                                        premise.loc_short_name
                                                                     AS
                       Common_Premise_Name,
                                        Employee_Snapshot.employee_id
                                                                     AS
                                        Employee_ID,
                                        Evaluation_Attributes.review_desc
                                                                     AS
                                        Evaluation_ID,
                                        Evaluation_Attributes.version
                                                                     AS
                       Evaluation_EvalDate,
Evaluation_Attributes.review_desc_version
                             AS
Evaluation_ID_and_EvalDate,
Evaluation_Attributes.review_type
                             AS
Evaluation_Type,
Evaluation_Attributes.review_desc_long
                             AS
Evaluation_Name,
Evaluation_Attributes.review_group
                             AS
Evaluation_Group,
Evaluation_Attributes.review_category
                             AS
Evaluation_Category,
Evaluation_Attributes.review_vendor
                             AS
Evaluation_Vendor,
Evaluation_Ctgy_Attributes.point_desc
                             AS
Ctgy_Identifier,
Evaluation_Ctgy_Attributes.point_subject_area
                             AS
Ctgy_Subject_Area_Code,
Evaluation_Ctgy_Attributes.point_item_type
                             AS c16,
CASE
  WHEN Evaluation_Ctgy_Levels.attain_code =
       'NA' THEN '0'
  ELSE Evaluation_Ctgy_Levels.attain_code
END
                             AS
Attained_Level_Code,
Employee_Snapshot.pel_part_code
                             AS
LPP__Participation_Code,
Employee_Snapshot.pel_part
                             AS
LPP__Participation
FROM   rzaj.office Office,
rzaj.premise Premise,
rzaj.emp_snapshot Employee_Snapshot,
rzaj.evaluation_info Evaluation_Attributes,
rzaj.evaluation_item Evaluation_Ctgy_Attributes,
rzaj.evaluation_fact Evaluation_Ctgy_Levels
WHERE  Evaluation_Attributes.review_desc = 'PAELL'
AND Dateadd(year, 2, Cast(
Evaluation_Ctgy_Levels.eval_date AS DATE)) =
{d '2014-02-02'}
AND Evaluation_Ctgy_Attributes.point_subject_area =
'Tender'
AND Employee_Snapshot.pel_part_code IN ( '01', '02' )
AND office.office_key =
Evaluation_Ctgy_Levels.office_key
AND Evaluation_Attributes.review_key =
Evaluation_Ctgy_Levels.review_key
AND premise.premise_key =
Evaluation_Ctgy_Levels.premise_key
AND Employee_Snapshot.employee_key =
Evaluation_Ctgy_Levels.employee_key
AND Evaluation_Ctgy_Attributes.point_key =
Evaluation_Ctgy_Levels.point_key
AND ( office.office_code = 4322 ))
Evaluation_Previous_Year_2
ON KXos1.employee_id = Evaluation_Previous_Year_2.employee_id 

Open in new window

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 45

Accepted Solution

by:
aikimark earned 166 total points
Comment Utility
I think the result from http://poorsql.com/ is better.
SELECT KXos1.Office_Code AS Office_Code
	,KXos1.Office_Name AS Office_Name
	,KXos1.KXos_3_Served AS KXos_3_Served
	,KXos1.Employee_ID AS Employee_ID
	,KXos1.c5 AS c5
	,KXos1.Passed AS Passed
	,KXos1.c7 AS c7
	,Evaluation_Previous_Year_2.Attained_Level_Code AS c8
	,CASE 
		WHEN NOT KXos1.c7 IS NULL
			THEN CASE 
					WHEN CAST(KXos1.c5 AS REAL) - CAST(KXos1.c7 AS REAL) >= .6
						THEN 1
					ELSE 0
					END
		WHEN NOT Evaluation_Previous_Year_2.Attained_Level_Code IS NULL
			THEN CASE 
					WHEN CAST(KXos1.c5 AS REAL) - CAST(Evaluation_Previous_Year_2.Attained_Level_Code AS REAL) >= .6
						THEN 1
					ELSE 0
					END
		ELSE 0
		END AS Growth
	,CASE 
		WHEN KXos1.Passed = 0
			AND CASE 
				WHEN NOT KXos1.c7 IS NULL
					THEN CASE 
							WHEN (CAST(KXos1.c5 AS REAL) - CAST(KXos1.c7 AS REAL) >= .6)
								THEN 1
							ELSE 0
							END
				WHEN NOT Evaluation_Previous_Year_2.Attained_Level_Code IS NULL
					THEN CASE 
							WHEN (CAST(KXos1.c5 AS REAL) - CAST(Evaluation_Previous_Year_2.Attained_Level_Code AS REAL) >= .6)
								THEN 1
							ELSE 0
							END
				ELSE 0
				END = 0
			THEN 1
		ELSE 0
		END AS No_Up
FROM (
	SELECT KXos3_Assess_CurrentYear.Office_Code AS Office_Code
		,KXos3_Assess_CurrentYear.Office_Name AS Office_Name
		,KXos3_Assess_CurrentYear.KXos_3_Served AS KXos_3_Served
		,KXos3_Assess_CurrentYear.Employee_ID AS Employee_ID
		,KXos3_Assess_CurrentYear.c5 AS c5
		,KXos3_Assess_CurrentYear.Passed AS Passed
		,Evaluation_Previous_Year_1.Attained_Level_Code AS c7
	FROM (
		SELECT DISTINCT KXos_3_Final.Office_Code AS Office_Code
			,KXos_3_Final.Office_Name AS Office_Name
			,KXos_3_Final.Employee_ID AS Employee_ID
			,KXos_3_Final.KXos_3_Served AS KXos_3_Served
			,Evaluation_Current_Year.Attained_Level_Code AS c5
			,CASE 
				WHEN Evaluation_Current_Year.Attained_Level_Code = 'NA'
					THEN 0
				WHEN Evaluation_Current_Year.Attained_Level_Code >= 4.5
					THEN 1
				ELSE 0
				END AS Passed
		FROM (
			SELECT DISTINCT KXos_3.Office_Code AS Office_Code
				,KXos_3.Office_Name AS Office_Name
				,KXos_3.Premise_ID AS Premise_ID
				,KXos_3.Full_Premise_Name AS Full_Premise_Name
				,KXos_3.Employee_ID AS Employee_ID
				,KXos_3.Current_Position_Level AS Current_Position_Level
				,KXos_3.Ethnicity AS Ethnicity
				,KXos_3.Ethnicity_Code AS Ethnicity_Code
				,KXos_3.Employee_Gender AS Employee_Gender
				,KXos_3.Employee_Gender_Code AS Employee_Gender_Code
				,KXos_3.Main_Skill_Code AS Main_Skill_Code
				,KXos_3.MainSkillCode AS MainSkillCode
				,KXos_3.KXos_3_Served AS KXos_3_Served
				,KXos_3.Current_PEL AS Current_PEL
			FROM (
				SELECT Office.Office_CODE AS Office_Code
					,Office.Office_NAME AS Office_Name
					,Premise.Premise_ID AS Premise_ID
					,Premise.Premise_NAME AS Full_Premise_Name
					,Employee_Snapshot.Employee_ID AS Employee_ID
					,Employee_Snapshot.CURR_Position_LVL AS Current_Position_Level
					,Employee_Snapshot.ETHNIC_DESC AS Ethnicity
					,Employee_Snapshot.ETHNIC_CODE AS Ethnicity_Code
					,Employee_Snapshot.Employee_GENDER AS Employee_Gender
					,Employee_Snapshot.Employee_GENDER_CD AS Employee_Gender_Code
					,Employee_Snapshot.MAIN_PRIM_SKILL AS Main_Skill_Code
					,Employee_Snapshot.MainSkillCode AS MainSkillCode
					,1 AS KXos_3_Served
					,CASE 
						WHEN Employee_Snapshot.PEL_PART_CODE IN (
								'01'
								,'02'
								)
							THEN 'Y'
						ELSE 'N'
						END AS Current_PEL
					,Employee_Snapshot.PEL_DURATION AS LPP__Duration
					,Employee_Snapshot.PEL_ELIGIBILITY AS LPP__Eligibility
					,Employee_Snapshot.PEL_ELIGIBIL_CODE AS LPP__Eligibility_Code
					,Employee_Snapshot.PEL_PART AS LPP__Participation
					,Employee_Snapshot.PEL_PART_CODE AS LPP__Participation_Code
				FROM RZAJ.Office Office
					,RZAJ.Premise Premise
					,RZAJ.EMP_SNAPSHOT Employee_Snapshot
				WHERE cast(Employee_Snapshot.EVAL_DATE AS DATE) = {d '2014-02-02' }
					AND cast(Employee_Snapshot.SNAPSHOT_DATE AS DATE) = {d '2014-02-02' }
					AND (
						Office.LEVEL_AGGR IN (
							'D1'
							,'S1'
							)
						OR Premise.ORG_TYPE_CODE = 'CC'
						)
					AND Employee_Snapshot.PEL_PART_CODE IN (
						'01'
						,'02'
						)
					AND Employee_Snapshot.PEL_ELIGIBILITY = 'KXos 3Served'
					AND Office.Office_KEY = Employee_Snapshot.Office_KEY
					AND Premise.Premise_KEY = Employee_Snapshot.Premise_KEY
					AND (Office.Office_CODE = 4322)
				) KXos_3
			) KXos_3_Final
		LEFT JOIN (
			SELECT DISTINCT Office.Office_CODE AS Office_Code
				,Office.Office_NAME AS Office_Name
				,Premise.Premise_ID AS Premise_ID
				,Premise.LOC_SHORT_NAME AS Common_Premise_Name
				,Employee_Snapshot.Employee_ID AS Employee_ID
				,Evaluation_Attributes.REVIEW_DESC AS Evaluation_ID
				,Evaluation_Attributes.VERSION AS Evaluation_EvalDate
				,Evaluation_Attributes.REVIEW_DESC_VERSION AS Evaluation_ID_and_EvalDate
				,Evaluation_Attributes.REVIEW_TYPE AS Evaluation_Type
				,Evaluation_Attributes.REVIEW_DESC_LONG AS Evaluation_Name
				,Evaluation_Attributes.REVIEW_GROUP AS Evaluation_Group
				,Evaluation_Attributes.REVIEW_CATEGORY AS Evaluation_Category
				,Evaluation_Attributes.REVIEW_VENDOR AS Evaluation_Vendor
				,Evaluation_Ctgy_Attributes.POINT_DESC AS Ctgy_Identifier
				,Evaluation_Ctgy_Attributes.POINT_SUBJECT_AREA AS Ctgy_Subject_Area_Code
				,Evaluation_Ctgy_Attributes.POINT_ITEM_TYPE AS c16
				,CASE 
					WHEN Evaluation_Ctgy_Levels.ATTAIN_CODE = ' NA '
						THEN '0'
					ELSE Evaluation_Ctgy_Levels.ATTAIN_CODE
					END AS Attained_Level_Code
				,Employee_Snapshot.PEL_PART_CODE AS LPP__Participation_Code
				,Employee_Snapshot.PEL_PART AS LPP__Participation
				,CASE 
					WHEN Evaluation_Ctgy_Levels.ATTAIN_CODE = ' NA '
						THEN '0'
					WHEN CAST(Evaluation_Ctgy_Levels.ATTAIN_CODE AS REAL) > 4.4
						THEN '1'
					ELSE '0'
					END AS Attainment
			FROM RZAJ.Office Office
				,RZAJ.Premise Premise
				,RZAJ.EMP_SNAPSHOT Employee_Snapshot
				,RZAJ.Evaluation_INFO Evaluation_Attributes
				,RZAJ.Evaluation_ITEM Evaluation_Ctgy_Attributes
				,RZAJ.Evaluation_FACT Evaluation_Ctgy_Levels
			WHERE Evaluation_Attributes.REVIEW_DESC = 'PAELL'
				AND Evaluation_Ctgy_Levels.EVAL_DATE = {d '2014-02-02' }
				AND Evaluation_Ctgy_Attributes.POINT_SUBJECT_AREA = 'Tender'
				AND Employee_Snapshot.PEL_PART_CODE IN (
					'01'
					,'02'
					)
				AND Office.Office_KEY = Evaluation_Ctgy_Levels.Office_KEY
				AND Evaluation_Attributes.REVIEW_KEY = Evaluation_Ctgy_Levels.REVIEW_KEY
				AND Premise.Premise_KEY = Evaluation_Ctgy_Levels.Premise_KEY
				AND Employee_Snapshot.Employee_KEY = Evaluation_Ctgy_Levels.Employee_KEY
				AND Evaluation_Ctgy_Attributes.POINT_KEY = Evaluation_Ctgy_Levels.POINT_KEY
				AND (Office.Office_CODE = 4322)
			) Evaluation_Current_Year ON KXos_3_Final.Employee_ID = Evaluation_Current_Year.Employee_ID
		) KXos3_Assess_CurrentYear
	LEFT JOIN (
		SELECT DISTINCT Office.Office_CODE AS Office_Code
			,Office.Office_NAME AS Office_Name
			,Premise.Premise_ID AS Premise_ID
			,Premise.LOC_SHORT_NAME AS Common_Premise_Name
			,Employee_Snapshot.Employee_ID AS Employee_ID
			,Evaluation_Attributes.REVIEW_DESC AS Evaluation_ID
			,Evaluation_Attributes.VERSION AS Evaluation_EvalDate
			,Evaluation_Attributes.REVIEW_DESC_VERSION AS Evaluation_ID_and_EvalDate
			,Evaluation_Attributes.REVIEW_TYPE AS Evaluation_Type
			,Evaluation_Attributes.REVIEW_DESC_LONG AS Evaluation_Name
			,Evaluation_Attributes.REVIEW_GROUP AS Evaluation_Group
			,Evaluation_Attributes.REVIEW_CATEGORY AS Evaluation_Category
			,Evaluation_Attributes.REVIEW_VENDOR AS Evaluation_Vendor
			,Evaluation_Ctgy_Attributes.POINT_DESC AS Ctgy_Identifier
			,Evaluation_Ctgy_Attributes.POINT_SUBJECT_AREA AS Ctgy_Subject_Area_Code
			,Evaluation_Ctgy_Attributes.POINT_ITEM_TYPE AS c16
			,CASE 
				WHEN Evaluation_Ctgy_Levels.ATTAIN_CODE = 'NA'
					THEN '0'
				ELSE Evaluation_Ctgy_Levels.ATTAIN_CODE
				END AS Attained_Level_Code
			,Employee_Snapshot.PEL_PART_CODE AS LPP__Participation_Code
			,Employee_Snapshot.PEL_PART AS LPP__Participation
		FROM RZAJ.Office Office
			,RZAJ.Premise Premise
			,RZAJ.EMP_SNAPSHOT Employee_Snapshot
			,RZAJ.Evaluation_INFO Evaluation_Attributes
			,RZAJ.Evaluation_ITEM Evaluation_Ctgy_Attributes
			,RZAJ.Evaluation_FACT Evaluation_Ctgy_Levels
		WHERE Evaluation_Attributes.REVIEW_DESC = 'PAELL'
			AND DATEADD(YEAR, 1, cast(Evaluation_Ctgy_Levels.EVAL_DATE AS DATE)) = {d '2014-02-02' }
			AND Evaluation_Ctgy_Attributes.POINT_SUBJECT_AREA = 'Tender'
			AND Employee_Snapshot.PEL_PART_CODE IN (
				'01'
				,'02'
				)
			AND Office.Office_KEY = Evaluation_Ctgy_Levels.Office_KEY
			AND Evaluation_Attributes.REVIEW_KEY = Evaluation_Ctgy_Levels.REVIEW_KEY
			AND Premise.Premise_KEY = Evaluation_Ctgy_Levels.Premise_KEY
			AND Employee_Snapshot.Employee_KEY = Evaluation_Ctgy_Levels.Employee_KEY
			AND Evaluation_Ctgy_Attributes.POINT_KEY = Evaluation_Ctgy_Levels.POINT_KEY
			AND (Office.Office_CODE = 4322)
		) Evaluation_Previous_Year_1 ON KXos3_Assess_CurrentYear.Employee_ID = Evaluation_Previous_Year_1.Employee_ID
	) KXos1
LEFT JOIN (
	SELECT DISTINCT Office.Office_CODE AS Office_Code
		,Office.Office_NAME AS Office_Name
		,Premise.Premise_ID AS Premise_ID
		,Premise.LOC_SHORT_NAME AS Common_Premise_Name
		,Employee_Snapshot.Employee_ID AS Employee_ID
		,Evaluation_Attributes.REVIEW_DESC AS Evaluation_ID
		,Evaluation_Attributes.VERSION AS Evaluation_EvalDate
		,Evaluation_Attributes.REVIEW_DESC_VERSION AS Evaluation_ID_and_EvalDate
		,Evaluation_Attributes.REVIEW_TYPE AS Evaluation_Type
		,Evaluation_Attributes.REVIEW_DESC_LONG AS Evaluation_Name
		,Evaluation_Attributes.REVIEW_GROUP AS Evaluation_Group
		,Evaluation_Attributes.REVIEW_CATEGORY AS Evaluation_Category
		,Evaluation_Attributes.REVIEW_VENDOR AS Evaluation_Vendor
		,Evaluation_Ctgy_Attributes.POINT_DESC AS Ctgy_Identifier
		,Evaluation_Ctgy_Attributes.POINT_SUBJECT_AREA AS Ctgy_Subject_Area_Code
		,Evaluation_Ctgy_Attributes.POINT_ITEM_TYPE AS c16
		,CASE 
			WHEN Evaluation_Ctgy_Levels.ATTAIN_CODE = 'NA'
				THEN '0'
			ELSE Evaluation_Ctgy_Levels.ATTAIN_CODE
			END AS Attained_Level_Code
		,Employee_Snapshot.PEL_PART_CODE AS LPP__Participation_Code
		,Employee_Snapshot.PEL_PART AS LPP__Participation
	FROM RZAJ.Office Office
		,RZAJ.Premise Premise
		,RZAJ.EMP_SNAPSHOT Employee_Snapshot
		,RZAJ.Evaluation_INFO Evaluation_Attributes
		,RZAJ.Evaluation_ITEM Evaluation_Ctgy_Attributes
		,RZAJ.Evaluation_FACT Evaluation_Ctgy_Levels
	WHERE Evaluation_Attributes.REVIEW_DESC = 'PAELL'
		AND DATEADD(YEAR, 2, cast(Evaluation_Ctgy_Levels.EVAL_DATE AS DATE)) = {d '2014-02-02' }
		AND Evaluation_Ctgy_Attributes.POINT_SUBJECT_AREA = 'Tender'
		AND Employee_Snapshot.PEL_PART_CODE IN (
			'01'
			,'02'
			)
		AND Office.Office_KEY = Evaluation_Ctgy_Levels.Office_KEY
		AND Evaluation_Attributes.REVIEW_KEY = Evaluation_Ctgy_Levels.REVIEW_KEY
		AND Premise.Premise_KEY = Evaluation_Ctgy_Levels.Premise_KEY
		AND Employee_Snapshot.Employee_KEY = Evaluation_Ctgy_Levels.Employee_KEY
		AND Evaluation_Ctgy_Attributes.POINT_KEY = Evaluation_Ctgy_Levels.POINT_KEY
		AND (Office.Office_CODE = 4322)
	) Evaluation_Previous_Year_2 ON KXos1.Employee_ID = Evaluation_Previous_Year_2.Employee_ID

Open in new window

0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 83 total points
Comment Utility
And this is the one from Red-Gate's SQL Prompt:
SELECT  "KXos1"."Office_Code" AS "Office_Code",
        "KXos1"."Office_Name" AS "Office_Name",
        "KXos1"."KXos_3_Served" AS "KXos_3_Served",
        "KXos1"."Employee_ID" AS "Employee_ID",
        "KXos1"."c5" AS "c5",
        "KXos1"."Passed" AS "Passed",
        "KXos1"."c7" AS "c7",
        "Evaluation_Previous_Year_2"."Attained_Level_Code" AS "c8",
        CASE WHEN NOT "KXos1"."c7" IS NULL THEN CASE WHEN CAST("KXos1"."c5" AS REAL) - CAST("KXos1"."c7" AS REAL) >= .6 THEN 1
                                                     ELSE 0
                                                END
             WHEN NOT "Evaluation_Previous_Year_2"."Attained_Level_Code" IS NULL THEN CASE WHEN CAST("KXos1"."c5" AS REAL) - CAST("Evaluation_Previous_Year_2"."Attained_Level_Code" AS REAL) >= .6 THEN 1
                                                                                           ELSE 0
                                                                                      END
             ELSE 0
        END AS "Growth",
        CASE WHEN "KXos1"."Passed" = 0
                  AND CASE WHEN NOT "KXos1"."c7" IS NULL THEN CASE WHEN (CAST("KXos1"."c5" AS REAL) - CAST("KXos1"."c7" AS REAL) >= .6) THEN 1
                                                                   ELSE 0
                                                              END
                           WHEN NOT "Evaluation_Previous_Year_2"."Attained_Level_Code" IS NULL THEN CASE WHEN (CAST("KXos1"."c5" AS REAL) - CAST("Evaluation_Previous_Year_2"."Attained_Level_Code" AS REAL) >= .6) THEN 1
                                                                                                         ELSE 0
                                                                                                    END
                           ELSE 0
                      END = 0 THEN 1
             ELSE 0
        END AS "No_Up"
FROM    (SELECT "KXos3_Assess_CurrentYear"."Office_Code" AS "Office_Code",
                "KXos3_Assess_CurrentYear"."Office_Name" AS "Office_Name",
                "KXos3_Assess_CurrentYear"."KXos_3_Served" AS "KXos_3_Served",
                "KXos3_Assess_CurrentYear"."Employee_ID" AS "Employee_ID",
                "KXos3_Assess_CurrentYear"."c5" AS "c5",
                "KXos3_Assess_CurrentYear"."Passed" AS "Passed",
                "Evaluation_Previous_Year_1"."Attained_Level_Code" AS "c7"
         FROM   (SELECT DISTINCT
                        "KXos_3_Final"."Office_Code" AS "Office_Code",
                        "KXos_3_Final"."Office_Name" AS "Office_Name",
                        "KXos_3_Final"."Employee_ID" AS "Employee_ID",
                        "KXos_3_Final"."KXos_3_Served" AS "KXos_3_Served",
                        "Evaluation_Current_Year"."Attained_Level_Code" AS "c5",
                        CASE WHEN "Evaluation_Current_Year"."Attained_Level_Code" = 'NA' THEN 0
                             WHEN "Evaluation_Current_Year"."Attained_Level_Code" >= 4.5 THEN 1
                             ELSE 0
                        END AS "Passed"
                 FROM   (SELECT DISTINCT
                                "KXos_3"."Office_Code" AS "Office_Code",
                                "KXos_3"."Office_Name" AS "Office_Name",
                                "KXos_3"."Premise_ID" AS "Premise_ID",
                                "KXos_3"."Full_Premise_Name" AS "Full_Premise_Name",
                                "KXos_3"."Employee_ID" AS "Employee_ID",
                                "KXos_3"."Current_Position_Level" AS "Current_Position_Level",
                                "KXos_3"."Ethnicity" AS "Ethnicity",
                                "KXos_3"."Ethnicity_Code" AS "Ethnicity_Code",
                                "KXos_3"."Employee_Gender" AS "Employee_Gender",
                                "KXos_3"."Employee_Gender_Code" AS "Employee_Gender_Code",
                                "KXos_3"."Main_Skill_Code" AS "Main_Skill_Code",
                                "KXos_3"."MainSkillCode" AS "MainSkillCode",
                                "KXos_3"."KXos_3_Served" AS "KXos_3_Served",
                                "KXos_3"."Current_PEL" AS "Current_PEL"
                         FROM   (SELECT "Office"."Office_CODE" AS "Office_Code",
                                        "Office"."Office_NAME" AS "Office_Name",
                                        "Premise"."Premise_ID" AS "Premise_ID",
                                        "Premise"."Premise_NAME" AS "Full_Premise_Name",
                                        "Employee_Snapshot"."Employee_ID" AS "Employee_ID",
                                        "Employee_Snapshot"."CURR_Position_LVL" AS "Current_Position_Level",
                                        "Employee_Snapshot"."ETHNIC_DESC" AS "Ethnicity",
                                        "Employee_Snapshot"."ETHNIC_CODE" AS "Ethnicity_Code",
                                        "Employee_Snapshot"."Employee_GENDER" AS "Employee_Gender",
                                        "Employee_Snapshot"."Employee_GENDER_CD" AS "Employee_Gender_Code",
                                        "Employee_Snapshot"."MAIN_PRIM_SKILL" AS "Main_Skill_Code",
                                        "Employee_Snapshot"."MainSkillCode" AS "MainSkillCode",
                                        1 AS "KXos_3_Served",
                                        CASE WHEN "Employee_Snapshot"."PEL_PART_CODE" IN ('01', '02') THEN 'Y'
                                             ELSE 'N'
                                        END AS "Current_PEL",
                                        "Employee_Snapshot"."PEL_DURATION" AS "LPP__Duration",
                                        "Employee_Snapshot"."PEL_ELIGIBILITY" AS "LPP__Eligibility",
                                        "Employee_Snapshot"."PEL_ELIGIBIL_CODE" AS "LPP__Eligibility_Code",
                                        "Employee_Snapshot"."PEL_PART" AS "LPP__Participation",
                                        "Employee_Snapshot"."PEL_PART_CODE" AS "LPP__Participation_Code"
                                 FROM   "RZAJ"."Office" "Office",
                                        "RZAJ"."Premise" "Premise",
                                        "RZAJ"."EMP_SNAPSHOT" "Employee_Snapshot"
                                 WHERE  CAST("Employee_Snapshot"."EVAL_DATE" AS date) = {d '2014-02-02'}
                                        AND CAST("Employee_Snapshot"."SNAPSHOT_DATE" AS date) = {d '2014-02-02'}
                                        AND ("Office"."LEVEL_AGGR" IN ('D1', 'S1')
                                             OR "Premise"."ORG_TYPE_CODE" = 'CC'
                                            )
                                        AND "Employee_Snapshot"."PEL_PART_CODE" IN ('01', '02')
                                        AND "Employee_Snapshot"."PEL_ELIGIBILITY" = 'KXos 3Served'
                                        AND "Office"."Office_KEY" = "Employee_Snapshot"."Office_KEY"
                                        AND "Premise"."Premise_KEY" = "Employee_Snapshot"."Premise_KEY"
                                        AND ("Office"."Office_CODE" = 4322)
                                ) "KXos_3"
                        ) "KXos_3_Final"
                        LEFT OUTER JOIN (SELECT DISTINCT
                                                "Office"."Office_CODE" AS "Office_Code",
                                                "Office"."Office_NAME" AS "Office_Name",
                                                "Premise"."Premise_ID" AS "Premise_ID",
                                                "Premise"."LOC_SHORT_NAME" AS "Common_Premise_Name",
                                                "Employee_Snapshot"."Employee_ID" AS "Employee_ID",
                                                "Evaluation_Attributes"."REVIEW_DESC" AS "Evaluation_ID",
                                                "Evaluation_Attributes"."VERSION" AS "Evaluation_EvalDate",
                                                "Evaluation_Attributes"."REVIEW_DESC_VERSION" AS "Evaluation_ID_and_EvalDate",
                                                "Evaluation_Attributes"."REVIEW_TYPE" AS "Evaluation_Type",
                                                "Evaluation_Attributes"."REVIEW_DESC_LONG" AS "Evaluation_Name",
                                                "Evaluation_Attributes"."REVIEW_GROUP" AS "Evaluation_Group",
                                                "Evaluation_Attributes"."REVIEW_CATEGORY" AS "Evaluation_Category",
                                                "Evaluation_Attributes"."REVIEW_VENDOR" AS "Evaluation_Vendor",
                                                "Evaluation_Ctgy_Attributes"."POINT_DESC" AS "Ctgy_Identifier",
                                                "Evaluation_Ctgy_Attributes"."POINT_SUBJECT_AREA" AS "Ctgy_Subject_Area_Code",
                                                "Evaluation_Ctgy_Attributes"."POINT_ITEM_TYPE" AS "c16",
                                                CASE WHEN "Evaluation_Ctgy_Levels"."ATTAIN_CODE" = ' NA ' THEN '0'
                                                     ELSE "Evaluation_Ctgy_Levels"."ATTAIN_CODE"
                                                END AS "Attained_Level_Code",
                                                "Employee_Snapshot"."PEL_PART_CODE" AS "LPP__Participation_Code",
                                                "Employee_Snapshot"."PEL_PART" AS "LPP__Participation",
                                                CASE WHEN "Evaluation_Ctgy_Levels"."ATTAIN_CODE" = ' NA ' THEN '0'
                                                     WHEN CAST("Evaluation_Ctgy_Levels"."ATTAIN_CODE" AS REAL) > 4.4 THEN '1'
                                                     ELSE '0'
                                                END AS "Attainment"
                                         FROM   "RZAJ"."Office" "Office",
                                                "RZAJ"."Premise" "Premise",
                                                "RZAJ"."EMP_SNAPSHOT" "Employee_Snapshot",
                                                "RZAJ"."Evaluation_INFO" "Evaluation_Attributes",
                                                "RZAJ"."Evaluation_ITEM" "Evaluation_Ctgy_Attributes",
                                                "RZAJ"."Evaluation_FACT" "Evaluation_Ctgy_Levels"
                                         WHERE  "Evaluation_Attributes"."REVIEW_DESC" = 'PAELL'
                                                AND "Evaluation_Ctgy_Levels"."EVAL_DATE" = {d '2014-02-02'}
                                                AND "Evaluation_Ctgy_Attributes"."POINT_SUBJECT_AREA" = 'Tender'
                                                AND "Employee_Snapshot"."PEL_PART_CODE" IN ('01', '02')
                                                AND "Office"."Office_KEY" = "Evaluation_Ctgy_Levels"."Office_KEY"
                                                AND "Evaluation_Attributes"."REVIEW_KEY" = "Evaluation_Ctgy_Levels"."REVIEW_KEY"
                                                AND "Premise"."Premise_KEY" = "Evaluation_Ctgy_Levels"."Premise_KEY"
                                                AND "Employee_Snapshot"."Employee_KEY" = "Evaluation_Ctgy_Levels"."Employee_KEY"
                                                AND "Evaluation_Ctgy_Attributes"."POINT_KEY" = "Evaluation_Ctgy_Levels"."POINT_KEY"
                                                AND ("Office"."Office_CODE" = 4322)
                                        ) "Evaluation_Current_Year" ON "KXos_3_Final"."Employee_ID" = "Evaluation_Current_Year"."Employee_ID"
                ) "KXos3_Assess_CurrentYear"
                LEFT OUTER JOIN (SELECT DISTINCT
                                        "Office"."Office_CODE" AS "Office_Code",
                                        "Office"."Office_NAME" AS "Office_Name",
                                        "Premise"."Premise_ID" AS "Premise_ID",
                                        "Premise"."LOC_SHORT_NAME" AS "Common_Premise_Name",
                                        "Employee_Snapshot"."Employee_ID" AS "Employee_ID",
                                        "Evaluation_Attributes"."REVIEW_DESC" AS "Evaluation_ID",
                                        "Evaluation_Attributes"."VERSION" AS "Evaluation_EvalDate",
                                        "Evaluation_Attributes"."REVIEW_DESC_VERSION" AS "Evaluation_ID_and_EvalDate",
                                        "Evaluation_Attributes"."REVIEW_TYPE" AS "Evaluation_Type",
                                        "Evaluation_Attributes"."REVIEW_DESC_LONG" AS "Evaluation_Name",
                                        "Evaluation_Attributes"."REVIEW_GROUP" AS "Evaluation_Group",
                                        "Evaluation_Attributes"."REVIEW_CATEGORY" AS "Evaluation_Category",
                                        "Evaluation_Attributes"."REVIEW_VENDOR" AS "Evaluation_Vendor",
                                        "Evaluation_Ctgy_Attributes"."POINT_DESC" AS "Ctgy_Identifier",
                                        "Evaluation_Ctgy_Attributes"."POINT_SUBJECT_AREA" AS "Ctgy_Subject_Area_Code",
                                        "Evaluation_Ctgy_Attributes"."POINT_ITEM_TYPE" AS "c16",
                                        CASE WHEN "Evaluation_Ctgy_Levels"."ATTAIN_CODE" = 'NA' THEN '0'
                                             ELSE "Evaluation_Ctgy_Levels"."ATTAIN_CODE"
                                        END AS "Attained_Level_Code",
                                        "Employee_Snapshot"."PEL_PART_CODE" AS "LPP__Participation_Code",
                                        "Employee_Snapshot"."PEL_PART" AS "LPP__Participation"
                                 FROM   "RZAJ"."Office" "Office",
                                        "RZAJ"."Premise" "Premise",
                                        "RZAJ"."EMP_SNAPSHOT" "Employee_Snapshot",
                                        "RZAJ"."Evaluation_INFO" "Evaluation_Attributes",
                                        "RZAJ"."Evaluation_ITEM" "Evaluation_Ctgy_Attributes",
                                        "RZAJ"."Evaluation_FACT" "Evaluation_Ctgy_Levels"
                                 WHERE  "Evaluation_Attributes"."REVIEW_DESC" = 'PAELL'
                                        AND DATEADD(YEAR, 1, CAST("Evaluation_Ctgy_Levels"."EVAL_DATE" AS date)) = {d '2014-02-02'}
                                        AND "Evaluation_Ctgy_Attributes"."POINT_SUBJECT_AREA" = 'Tender'
                                        AND "Employee_Snapshot"."PEL_PART_CODE" IN ('01', '02')
                                        AND "Office"."Office_KEY" = "Evaluation_Ctgy_Levels"."Office_KEY"
                                        AND "Evaluation_Attributes"."REVIEW_KEY" = "Evaluation_Ctgy_Levels"."REVIEW_KEY"
                                        AND "Premise"."Premise_KEY" = "Evaluation_Ctgy_Levels"."Premise_KEY"
                                        AND "Employee_Snapshot"."Employee_KEY" = "Evaluation_Ctgy_Levels"."Employee_KEY"
                                        AND "Evaluation_Ctgy_Attributes"."POINT_KEY" = "Evaluation_Ctgy_Levels"."POINT_KEY"
                                        AND ("Office"."Office_CODE" = 4322)
                                ) "Evaluation_Previous_Year_1" ON "KXos3_Assess_CurrentYear"."Employee_ID" = "Evaluation_Previous_Year_1"."Employee_ID"
        ) "KXos1"
        LEFT OUTER JOIN (SELECT DISTINCT
                                "Office"."Office_CODE" AS "Office_Code",
                                "Office"."Office_NAME" AS "Office_Name",
                                "Premise"."Premise_ID" AS "Premise_ID",
                                "Premise"."LOC_SHORT_NAME" AS "Common_Premise_Name",
                                "Employee_Snapshot"."Employee_ID" AS "Employee_ID",
                                "Evaluation_Attributes"."REVIEW_DESC" AS "Evaluation_ID",
                                "Evaluation_Attributes"."VERSION" AS "Evaluation_EvalDate",
                                "Evaluation_Attributes"."REVIEW_DESC_VERSION" AS "Evaluation_ID_and_EvalDate",
                                "Evaluation_Attributes"."REVIEW_TYPE" AS "Evaluation_Type",
                                "Evaluation_Attributes"."REVIEW_DESC_LONG" AS "Evaluation_Name",
                                "Evaluation_Attributes"."REVIEW_GROUP" AS "Evaluation_Group",
                                "Evaluation_Attributes"."REVIEW_CATEGORY" AS "Evaluation_Category",
                                "Evaluation_Attributes"."REVIEW_VENDOR" AS "Evaluation_Vendor",
                                "Evaluation_Ctgy_Attributes"."POINT_DESC" AS "Ctgy_Identifier",
                                "Evaluation_Ctgy_Attributes"."POINT_SUBJECT_AREA" AS "Ctgy_Subject_Area_Code",
                                "Evaluation_Ctgy_Attributes"."POINT_ITEM_TYPE" AS "c16",
                                CASE WHEN "Evaluation_Ctgy_Levels"."ATTAIN_CODE" = 'NA' THEN '0'
                                     ELSE "Evaluation_Ctgy_Levels"."ATTAIN_CODE"
                                END AS "Attained_Level_Code",
                                "Employee_Snapshot"."PEL_PART_CODE" AS "LPP__Participation_Code",
                                "Employee_Snapshot"."PEL_PART" AS "LPP__Participation"
                         FROM   "RZAJ"."Office" "Office",
                                "RZAJ"."Premise" "Premise",
                                "RZAJ"."EMP_SNAPSHOT" "Employee_Snapshot",
                                "RZAJ"."Evaluation_INFO" "Evaluation_Attributes",
                                "RZAJ"."Evaluation_ITEM" "Evaluation_Ctgy_Attributes",
                                "RZAJ"."Evaluation_FACT" "Evaluation_Ctgy_Levels"
                         WHERE  "Evaluation_Attributes"."REVIEW_DESC" = 'PAELL'
                                AND DATEADD(YEAR, 2, CAST("Evaluation_Ctgy_Levels"."EVAL_DATE" AS date)) = {d '2014-02-02'}
                                AND "Evaluation_Ctgy_Attributes"."POINT_SUBJECT_AREA" = 'Tender'
                                AND "Employee_Snapshot"."PEL_PART_CODE" IN ('01', '02')
                                AND "Office"."Office_KEY" = "Evaluation_Ctgy_Levels"."Office_KEY"
                                AND "Evaluation_Attributes"."REVIEW_KEY" = "Evaluation_Ctgy_Levels"."REVIEW_KEY"
                                AND "Premise"."Premise_KEY" = "Evaluation_Ctgy_Levels"."Premise_KEY"
                                AND "Employee_Snapshot"."Employee_KEY" = "Evaluation_Ctgy_Levels"."Employee_KEY"
                                AND "Evaluation_Ctgy_Attributes"."POINT_KEY" = "Evaluation_Ctgy_Levels"."POINT_KEY"
                                AND ("Office"."Office_CODE" = 4322)
                        ) "Evaluation_Previous_Year_2" ON "KXos1"."Employee_ID" = "Evaluation_Previous_Year_2"."Employee_ID"

Open in new window

And yes, it is in urgent need of re-factoring.
0
 
LVL 37

Assisted Solution

by:ValentinoV
ValentinoV earned 83 total points
Comment Utility
In this --> = {d '2014-02-02'} <--, what's the purpose of the { } and d?

Wow, had to look that one up too.  Apparently it's the ODBC way of specifying a date literal, so this works fine:

declare @dt date = {d '2014-02-02'};
select DATEADD(d, 42, @dt)

Open in new window

But I don't think I'm going to adopt this syntax :)

Details in the Supported String Literal Formats for date section: date (Transact-SQL) [MSDN]
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
Apparently it's the ODBC way of specifying a date literal, so this works fine:
Yep.  It has been there since I believe SQL Server 6.5
0
 
LVL 5

Author Comment

by:25112
Comment Utility
Jim Horn and others..
thank you- will implement ideas and the tools helped.
0
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
Thanks for the split.  Good luck with the code.  -Jim
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Query Assistance 4 29
SQL Script to find duplicates 16 17
search for a string in all tables 4 15
replication - alerts? 4 19
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now