How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask ComputersGuru Your Own Question

ComputersGuru
ComputersGuru, Computer Enthusiast
Category: Software
Satisfied Customers: 12508
Experience:  Expert to handle computer software issues
29751445
Type Your Software Question Here...
ComputersGuru is online now
A new question is answered every 9 seconds

Best way to describe my issue is this: I have three tables.

Customer Question

Best way to describe my issue is this:I have three tables. I want all of the records in table 1. When I join table 1 to table 2 by doing a left join, I can get all of the records from table1 with no problem. So now I want to join a table 2 to table 3. Table 3 has no key fields I can join to table 1. But I can join table 2 to table 3. However when I do that, I only get the records that table 2 and table 1 have in common, that is, a simple join. How can I join the 3 tables so I get all of the records in table one included in my results ?
Submitted: 8 months ago.
Category: Software
Expert:  Pete replied 8 months ago.

Hello,
What software are you using for this?

Customer: replied 8 months ago.
Tsql
Expert:  Pete replied 8 months ago.

Ok, let me see if another programmer can assist with this...

Customer: replied 8 months ago.
ok thanks
Customer: replied 8 months ago.
Anybody looking at this ?
Expert:  ComputersGuru replied 8 months ago.

Hi,

I can help using secure remote connection by looking at the tables setup and query. let me know whwn you are ready for secure remote help

Customer: replied 8 months ago.
Can you solve without connection ?
Expert:  ComputersGuru replied 8 months ago.

yes. but it will take time. You would need to provide the table structure, queries you are using. Let me know if I can remote

Expert:  ComputersGuru replied 8 months ago.

Are you there?

Customer: replied 8 months ago.
I can't provide connection.
Expert:  ComputersGuru replied 8 months ago.

ok. Please provide the table structure and both the queries you are using.

Customer: replied 8 months ago.
Ok I'll need a few minutes
Expert:  ComputersGuru replied 8 months ago.

ok

Customer: replied 8 months ago.
left join dbo.BPO bpo
on bpo.BPO_ID=vouch.VOU_BPO_ID
JOIN (
SELECT bls.POS,bls.BPO_ID,bls.BPO_REQ_IDS
FROM dbo.BPO_LS bls
where bls.POS='1'
GROUP BY bls.BPO_ID,bls.BPO_REQ_IDS,bls.POS
) AS B
on B.BPO_ID=bpo.BPO_ID
left join [dbo].[REQUISITIONS] req
on req.REQUISITIONS_ID=B.BPO_REQ_IDSTables areVouchers - alias vouch
Blanket orders - alias bpls
Requistions – alias reqI want all records from Vouchers. Not all vouchers have records in Blanket Orders. All Blanket Orders have records in Requisitions. When I run my query, I only get the records in Vouchers that have Blanket Orders. It seems the problem occurs when I join Requistions.
Expert:  ComputersGuru replied 8 months ago.

So Vouchers is table1, Blanket orders is table2 and Requistions is table3?

Please provide the columns of these table along with primary and foreign keys

How you are joining the all these tables?

Customer: replied 8 months ago.
tables 1, 2, 3. The fields in the query I sent are key fields
Expert:  ComputersGuru replied 8 months ago.

In the provided query, two more tables are being used BPO and BPO_LS

Let us concentrate on the three- Vouchers, Blanket orders and Requistions, ok?

Please provide the columns of these table along with primary and foreign keys

Customer: replied 8 months ago.
BPO and BPO_LS are linked to each other by BPO_ID key field. I need BPO_LS to link to Requisitions. These tables each have many columns and I do not have the complete data structures handy.
Expert:  ComputersGuru replied 8 months ago.

ok. let me out out for others experts to help you on this in this case

I am out opting out for other Professionals to answer. Please wait. You will be notified by email as soon as any Professional joins you.

I would be happy to help you with your other questions though.

Thank you for your patience.