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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:08:42+00:00 2026-06-14T22:08:42+00:00

I am in an intro to database class and am having trouble with my

  • 0

I am in an intro to database class and am having trouble with my query. I am trying to return the information that would be generated for a PurchaseOrderHeader. I cannot get it to return anything.

Use [Sandwiches Inc]
GO

DECLARE 
@VendorID INT,
@TodaysDate DATETIME,

SELECT @VendorID = 3,
@TodaysDate = GETDATE();

SELECT
@VendorID AS Vendor,
@TodaysDate AS TDate,
V.Name,
V.Phone,
A2.Address1,
A2.Address2,
A2.AdressState,
A2.City,
A2.Zip,
A1.Address1,
A1.Address2,
A1.AdressState,
A1.City,
A1.Zip
FROM Vendor AS V
INNER JOIN VendorAddress AS VA1 on V.VendorId = VA1.VendorId
--INNER JOIN VendorAddress AS VA2 on V.VendorId = VA2.VendorId
INNER JOIN VdrAddress as A1 on VA1.VdrAddressId = A1.VdrAddressId
INNER JOIN VdrAddress AS A2 on VA1.VdrAddressId = A2.VdrAddressId
WHERE A1.Name = 'Billing' And A2.Name = 'Shipping' And V.VendorId = 3
GO

As it is now, it executes but does not return any columns. If I only do A1 or A2 and comment out one or the other, it works. It is when I try to do both that it fails.

Any help would be appreciated. If you need more information I can elaborate.

  • 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-14T22:08:43+00:00Added an answer on June 14, 2026 at 10:08 pm

    I don’t suppose you removed the WHERE constraints to see if there is actually nothing in the greater result set?

    I also assume there is relevant data in all the tables?

    Where I would go from here is to remove all but one join, then slowly re-add them so I can narrow down where the issue lays.

    Try that, and come back to us with more specifics.

    (Ps. this is hard to do when we have no idea what is in the tables)

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

Sidebar

Related Questions

I have a class that inserts information into a MySQL database. I have the
I am trying to insert into my database table using the database helper class.
I'm writing a class to insert users into a database, and before I get
I am having trouble with loading JSON into an app that im creating $(#load_basic).click(function(){
I want to use HSQLDB as an embedded database but am having trouble getting
I'm having trouble trying to map my EF 4.1 Code First model to a
I am having trouble returning data from my sql-server database to an aspx page
I'm having trouble querying my SQLite database using Android. I keep getting either an
I'm pretty sure that this have been answered before, but i'm having trouble in
I'm having trouble saving an entity into an SQL Server 2005 database. I'm using

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.