473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

What type of Query Should I use so My Data don’t Duplicate?

I’m trying to link four tables together.
In one table I'm going to be using all the fields [Feild1],[Feild2],[Feild3],[feild4]

In the other 3 queries I would like to all a column and put one row of data from each other query's [Feild1],[Feild2],[Feild3],[feild4] adding [FieldA],FieldB]

This shows just a select query in access, putting the tables together

[SQL]
SELECT Wholesale_Rank_qry_2.OMNI_Number,
Wholesale_Rank_qry_2.branch,
Wholesale_Rank_qry_2.branch_name,

Wholesale_Rank_qry_2.[Wholesale_Rank>],
Table_Rank_qry_2.[Table_Rank>],
Purchase_Rank_qry_2.[Purchase_Rank>],
CUSB_Rank_qry_2.[CUSB_Rank>]

FROM CUSB_Rank_qry_2 RIGHT JOIN (Purchase_Rank_qry_2 RIGHT JOIN (Table_Rank_qry_2 RIGHT JOIN Wholesale_Rank_qry_2 ON Table_Rank_qry_2.OMNI_Number = Wholesale_Rank_qry_2.OMNI_Number) ON Purchase_Rank_qry_2.OMNI_Number = Wholesale_Rank_qry_2.OMNI_Number) ON CUSB_Rank_qry_2.OMNI_Number = Wholesale_Rank_qry_2.OMNI_Number; [/sql]

The main table with all the data in it is Wholesale_Rank_qry_2. <-This table will have all of the Wholesale_Rank field’s populated.

Now the queries below will only have the rank field populated if they have a rank from there original table

Table_Rank_qry_2.[Table_Rank>],
Purchase_Rank_qry_2.[Purchase_Rank>],
CUSB_Rank_qry_2.[CUSB_Rank>]

Thanks for taking the time to help me learn more about what queries I can us

TCB

I'm looking to see all the records from Wholesale Rank, but then in the other fields that come from a different table would show blank fields because they don’t have records for all three tables
Jan 5 '11 #1
1 1226
Brian Connelly
103 100+
Did you try adding a condition such as Not Null. This would only return fields that have data in them.
Jan 5 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: gtux | last post by:
Hi everybody: I'm new in Javascript, I found some code and there is this: var fruit = { 'apple' : { 'weight' : 10, 'cost' : 9}, 'peach' : { 'weight' : 19, 'cost' : 10} }
4
by: Andy Davis | last post by:
I have developed a number of reports that are based on parameter queries where the user enters criteria such as a date range and a sales rep say. I want to be able to show a graphical picture in...
2
by: gn | last post by:
I am able to populate a datagrid from an XML variable using the following: Try Dim ds As New DataSet ds.ReadXml(New StringReader(HttpContext.Current.Application("var").ToString))...
1
by: neeraj | last post by:
Hi All Can any give me the code for convert "DataColumn" data type of "DataTable". Even if data table already populated (have data) Actually I am creating one search module which searches the...
1
by: goc | last post by:
I have a Web Farm, that fetches its database-data from a separate database-server. Today I was forced to go over to .NET 2.0 (since 1.1 can't be installed on Windows Vista x64), and it brought...
10
by: aaronrm | last post by:
I have a real simple cross-tab query that I am trying to sum on as the action but I am getting the "data type mismatch criteria expression" error. About three queries up the food chain from this...
2
by: lindabaldwin | last post by:
Hello everyone, I am fairly new to VBA. I have a worksheet in Excel, named "Data Sheet" from which I am trying to query data. This worksheet contains the following data: unit (column A), date...
9
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all On SQL Server tables I use SqlDataReader to query data like "SELECT * FROM table". Is there something similar for XML Files ? I want to use SQL Syntax like "SELECT * FROM table" on a...
4
by: Cirene | last post by:
I know that there are several ways to access/query data. (Stored procs, direct SQL statements, etc...) Typically I write a simple Stored Procedure, then access it from my webform like this... ...
3
by: cbjones | last post by:
Before I ask my question, please know that I am quite new to writing SQL queries and I am struggling with a SELECT issue involving JOIN so if I sound a little naive, I am a true newbie. In...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.