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

  • Home
  • SEARCH
  • 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 8653145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:28:21+00:00 2026-06-12T14:28:21+00:00

I have been tasked with creating an sql script based on an OrdinalPosition, as

  • 0

I have been tasked with creating an sql script based on an OrdinalPosition, as far as I can tell my code should be working, but there is apparently an “incorrect syntax” error near the very last “ViewData.SONumber” which I am both unable to solve and unable to identify. Can someone take a look and see if there is something my brain just isn’t processing?

FROM    tblReps RIGHT OUTER JOIN tblServiceOrders RIGHT OUTER JOIN     dbo.tblCustomFieldDefinitions LEFT OUTER JOIN
                    (SELECT SONumber, [1] AS [ShippingCompany], [2] AS [Consignment_Number]
                    FROM        (SELECT     tvw_CustomSOFieldData.SONumber, tvw_CustomSOFieldData.CustomFieldValue, tvw_CustomSOFieldData.OrdinalPosition
                                FROM    tvw_CustomSOFieldData)
                                PivotData PIVOT(max(CustomFieldValue) FOR OrdinalPosition IN ([1], [2])) AS CustomFieldsPivot)
                                AS ViewData ON tblServiceOrders.SONumber = ViewData.SONumber
  • 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-12T14:28:23+00:00Added an answer on June 12, 2026 at 2:28 pm

    Well it appears you are missing several things with your syntax. You are missing the ON syntax on several of your JOINs:

    FROM    tblReps 
    RIGHT OUTER JOIN tblServiceOrders 
      ON -- missing JOIN
    RIGHT OUTER JOIN dbo.tblCustomFieldDefinitions 
      ON -- missing JOIN
    LEFT OUTER JOIN
    (
      SELECT SONumber, 
        [1] AS [ShippingCompany], 
        [2] AS [Consignment_Number]
      FROM        
      (
        SELECT tvw_CustomSOFieldData.SONumber, 
          tvw_CustomSOFieldData.CustomFieldValue, 
          tvw_CustomSOFieldData.OrdinalPosition
        FROM    tvw_CustomSOFieldData
      ) PivotData 
      PIVOT
      (
        max(CustomFieldValue) 
        FOR OrdinalPosition IN ([1], [2])
      ) CustomFieldsPivot
    ) ViewData 
      ON tblServiceOrders.SONumber = ViewData.SONumber
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been tasked with the job of creating a web based system to
I have been tasked with creating a SQL query (limited knowledge) that will show
I normally develop with VBA and MySQL, but have been tasked with creating a
I have been tasked with creating a site wide search feature. The search needs
I have been tasked with designing my web services client code to use the
I have been tasked with creating a Software Installation Approval section for our Intranet.
I have been tasked with creating an API for retrieving and adding content to
I have been tasked with creating an application for a company to store current
Hello I have been tasked with creating a fairly complex web application in php,
I am new to WIX and have been tasked with creating an installer that

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.