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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:35:34+00:00 2026-06-07T23:35:34+00:00

I am connecting to a NetSuite database via ODBC and created a rather large

  • 0

I am connecting to a NetSuite database via ODBC and created a rather large query for the database to run a report. I’ve placed the code at the end of this post. My problem is, the query is excluding rows from the “A_T_PROJECTS” table that have NULL in the “TRADING_PARTNER_ID” field. I know I could use a RIGHT OUTER JOIN here, but I can’t seem to get it to work due to the fact that I am joining several other tables. Any suggestions on what I can try?

The connection is read-only, so no temporary tables – and I’d like this to work in a single query. Thanks for your time!

SELECT
    [A_T_CUSTOMERS].[COMPANYNAME] AS [Company Name],
    [A_T_MILESTONES].[PROJECT_MILESTONE_NAME] AS [Name],
    [A_T_PROJECTS].[COMPANYNAME] AS [Project Name],
    [A_T_STATUS].[LIST_ITEM_NAME] AS [Status],
    [A_T_MILESTONES].[DUE_DATE] AS [Milestone Due],
    [A_T_ACTIONREQ].[LIST_ITEM_NAME] AS [Action Required By],
    [A_T_PARTNERS].[COMPANYNAME] AS [Trading Partner],
    [A_T_EMPLOYEES].[FULL_NAME] AS [Assigned To],
    [A_T_CUSTOMERS].[ESTIMATED_DELIVERY_DATE] AS [Est Del Date],
    CASE
            WHEN [A_T_MILESTONES].[PROJECT_MILESTONE_NAME] = 'Project Complete/Move to Production'
                    THEN [A_T_MILESTONES].[DUE_DATE]
            ELSE NULL
    END AS [Est Move to Prod]

FROM
    [CUSTOMERS] AS [A_T_CUSTOMERS],
    [CUSTOMERS] AS [A_T_PROJECTS],
    [PROJECT_MILESTONE] AS [A_T_MILESTONES],
    [PARTNERS] AS [A_T_PARTNERS],
    [STATUS] AS [A_T_STATUS],
    [ACTION_REQUIRED] AS [A_T_ACTIONREQ],
    [EMPLOYEES] AS [A_T_EMPLOYEES]
    --RIGHT OUTER JOIN [PARTNERS] ON ([A_T_PARTNERS].[PARTNER_ID] = [A_T_PROJECTS].[TRADING_PARTNER_ID])

WHERE
    -- JOIN CLAUSES --
    [A_T_PROJECTS].[CUSTOMER_ID] = [A_T_MILESTONES].[PROJECT_NAME_ID]
    AND [A_T_CUSTOMERS].[CUSTOMER_ID] = [A_T_MILESTONES].[CUSTOMER_MILESTONE_NAME_ID]
    AND [A_T_PARTNERS].[PARTNER_ID] = [A_T_PROJECTS].[TRADING_PARTNER_ID]
    AND [A_T_EMPLOYEES].[EMPLOYEE_ID] = [A_T_MILESTONES].[ASSIGNED_TO_ID]
    AND [A_T_STATUS].[LIST_ID] = [A_T_MILESTONES].[STATUS_ID]
    AND [A_T_ACTIONREQ].[LIST_ID] = [A_T_MILESTONES].[ACTION_REQUIRED_BY_ID]

    -- FILTER CLAUSES --
    AND [A_T_CUSTOMERS].[CUSTOMER_SINCE] > '2011-12-10 00:00:00'
    AND ([A_T_MILESTONES].[STATUS_ID] = 1
            OR [A_T_MILESTONES].[STATUS_ID] = 2
            OR [A_T_MILESTONES].[STATUS_ID] = 3
            OR [A_T_MILESTONES].[STATUS_ID] = 5)
    AND ([A_T_PROJECTS].[STATUS] = 'Assigned'
            OR [A_T_PROJECTS].[STATUS] = 'Delayed - per Customer'
            OR [A_T_PROJECTS].[STATUS] = 'Delayed - per Internal'
            OR [A_T_PROJECTS].[STATUS] = 'Delayed - per TP/VAN'
            OR [A_T_PROJECTS].[STATUS] = 'In Progress'
            OR [A_T_PROJECTS].[STATUS] = 'Production'
            OR [A_T_PROJECTS].[STATUS] = 'On-Hold')
    AND [A_T_CUSTOMERS].[TRANSLATOR_ID] != 4
    AND [A_T_CUSTOMERS].[IN_PRODUCTION] = 'F'
    AND ([A_T_PROJECTS].[JOB_TYPE_ID] IS NOT NULL
            OR [A_T_PROJECTS].[JOB_TYPE_ID] != 8
            OR [A_T_PROJECTS].[JOB_TYPE_ID] != 11)
  • 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-07T23:35:35+00:00Added an answer on June 7, 2026 at 11:35 pm

    You should consider using JOIN for each table instead of using WHERE clauses to link them. If both tables need to contain the same “Id”, then use TableA INNER JOIN TableB ON TableA.Id=TableB.Id. If you want all the TableA records even if some are missing in TableB, use the TableA LEFT JOIN TableB ON TableA.Id=TableB.Id. Any field from TableB without a match will show up as NULL.

    You can nest all the JOIN claues. I’m not sure how netsuite handles things, but you may need to put () around the join clauses.

    FROM (TableA AS A INNER JOIN TableB AS B ON A.id=B.id)
                      LEFT JOIN TableC AS C ON A.id=C.id
    

    Good luck.

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

Sidebar

Related Questions

ms-access is connecting to a local mysql database the following code returns an error:
I tried connecting to my cassandra cluster [version 1.0.6] via nodejs using node-cassandra-client This
connecting to a mysql database from java using jdbc. declaring a query String query
I am connecting an online MySQL database. I have downloaded MySQL ODBC Connector 5.1.
I am connecting to a mysql database using the following code: my $dbh =
When connecting to sql server, I have the hardcoded string (local). Is this a
I am connecting to an XML back-end to create different pages for a flash
I'm connecting to a database server (MSSS 2005, 9.0 SP2) which is almost totally
access is connecting to a mysql database. the rowsource of one of a listbox
I am connecting to a server from an android device and querying the database

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.