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 8708795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:13:14+00:00 2026-06-13T04:13:14+00:00

Long story short I’m reasonably new to T-SQL, and I’m working on querying some

  • 0

Long story short I’m reasonably new to T-SQL, and I’m working on querying some info out of JD Edwards for our scheduling department. We’re a manufacturing plant, and the table that contains our Part info and the components that go into making each part uses a single column for all components with multiple rows for each so we can have a single part with twenty rows, I have two problems with this query that have me a little stumped, the first is that I’d like to see one row per work order, that contains all of the part info, from the WO table I use our Finished part number in the following query:

Raw data from necessary columns for this WO & Finished Product:

WALITM                      IXLITM                      WADOCO
TF2-10426IA                 CF-S1094P-UL                800059
TF2-10426IA                 CF-S1094P-UL                800059
TF2-10426IA                 CF-S1094P-UL                800059
TF2-10426IA                 CF-S1094P-UL                800059
TF2-10426IA                 TE2-06718                   800059
TF2-10426IA                 TE2-06718                   800059
TF2-10426IA                 TE2-06718                   800059
TF2-10426IA                 TE2-06718                   800059
TF2-10426IA                 RP-TR23                     800059
TF2-10426IA                 RP-TR23                     800059
TF2-10426IA                 RP-TR23                     800059
TF2-10426IA                 RP-TR23                     800059
TF2-10426IA                 RP-BX35                     800059
TF2-10426IA                 RP-BX35                     800059
TF2-10426IA                 RP-BX35                     800059
TF2-10426IA                 RP-BX35                     800059

(Sorry apparently a complete n00b today, aside from creating an HTML table, couldn’t figure out how to get this to format into a table)

    SELECT WO, TF, TE, CAP, LABEL
    FROM (SELECT DISTINCT Sched.dbo.TBS.WADOCO AS WO,
    Sched.dbo.TBS.WALITM AS TF,
    CASE WHEN Part.IXLITM LIKE 'TE%' THEN Part.IXLITM END AS TE,
    CASE WHEN Part.IXLITM LIKE 'CF%' THEN Part.IXLITM END AS CAP,
    CASE WHEN Part.IXLITM LIKE 'LBL%' THEN Part.IXLITM END AS LABEL
    FROM WB.dbo.Part
    INNER JOIN Sched.dbo.TBS ON TBS.WAAITM=Part.IXKITA) AS T2
    WHERE WO=800059

Which Yields:

WO          TF            TE          CAP            LABEL
800059      TF2-10426IA   NULL        NULL           NULL
800059      TF2-10426IA   NULL        CF-S1094P-UL   NULL
800059      TF2-10426IA   TE2-06718   NULL           NULL

I’ve made a couple of other attempts at getting everything combined in one line but haven’t had any luck yet I think something similar to ‘Group By’ would be ideal…

The second part of this query that also has me a little stumped, although admittedly I’ve worked on the above more, is that I need to pull even more data out of the IXLITM column Where IXKITA=[The TE2***] for the TF2*** Number.

I think between the two issues I may look for a solution outside of T-SQL, but figured I’d ask for some insight from all you experts first.

Thanks in advance and any help is greatly appreciated!

  • 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-13T04:13:15+00:00Added an answer on June 13, 2026 at 4:13 am

    Try this:

    SELECT WO, 
           TF, 
           TE, 
           CAP, 
           LABEL 
    FROM   (SELECT DISTINCT WADOCO   AS WO, 
                            WALITM   AS TF, 
                            Max(CASE 
                                  WHEN IXLITM LIKE 'TE%' THEN PART.IXLITM 
                                  ELSE '' 
                                END) AS TE, 
                            Max(CASE 
                                  WHEN IXLITM LIKE 'CF%' THEN PART.IXLITM 
                                  ELSE '' 
                                END) AS CAP, 
                            Max(CASE 
                                  WHEN IXLITM LIKE 'LBL%' THEN PART.IXLITM 
                                  ELSE '' 
                                END) AS LABEL 
            FROM   PART 
            GROUP  BY WALITM, 
                      WADOCO)T2 
    WHERE  WO = 800059 
    

    There’s a working solution on SQL Fiddle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Long story short, we found files promoting prescription drugs on our server that we
Long story short is I tried to quickly update a single row in SQL
Long story short, I essentially created a branch of development within our trunk. About
Long story short, I have a SQL file that I want to import as
Long story short, I'm working on a .NET profiler that at one point gets
Long story short, VSS decided I wasn't allowed to have some code changes. I
Long story short, I'm working with a library with a bug that causes a
Long story short, I created a new gmail account, and linked several other accounts
Long story short, because of some issues with architecture and the fact that someone
Long story short: I've been layout out UI's with Html/CSS for about 8 years

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.