473,394 Members | 1,965 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,394 software developers and data experts.

Displaying all comapany branches

Hi there,

I'm trying to create a query that will display all branches in a company
even if that branch hasn't made a claim. The main manufacturing company
makes the machines and distributes the machines to the other branches and it
is up to each branch to sell the machines to the customers. It is also the
branches responsibility to make sure the machine is registered when sold and
to deal with any warranty claims. The branch then sends all registration
details and warranty claims back to the manufacture where the manufacture
processes them.

On a monthly basis the manufacture creates reports and send them back to the
branch notifying them of the status of each claim submitted: credited, on
hold or declined. I've created this report in 2 ways, one as a standard
Access report and the other in Excel. It's the one created in Excel that
they use because it can be emailed easily and each branch manager can sort
the information to their own liking.

Not every branch sends in warranty claims but the manufacture wants the
reports to display all the branches even if they haven't made a claim, at
the moment they only display the branches that have made claims.

*tblBranch*
BranchID (PK) Autonumber
Branch

*tblMachines*
MachineID (PK) Autonumber
S/N
etc

*tblRegistrationDetails*
RegID (PK) Autonumber
MachineID (FK) one to one from tblMachines
BranchID (FK) one branch can register many machines
etc

*tblWarrantyClaims*
WarrID (PK) Autonumber
RegID (FK) one registration can have many claims
ClaimNo
ClaimDate
Status (FK) from tblstatus
etc

The overall table structure is a bit more complicated than this but how can
I display all branches in the reports even if the branch hasn't made a
claim? Report must show S/N, ClaimNo, Branch, ClaimDate, Status plus a few
more items from a WarrantyDetails table.

TIA
Stewart

Nov 12 '05 #1
3 1555
Stewart,

It appears like you need to use a left or right outer join in your report
query. If you use a left outer join, the query will display all records in
the left table, even those without any related records in the right
table(s).

Best regards,

Todd

"Stewart Allen" <sa****@ThisPartNotVailid.wave.co.nz> wrote in message
news:bq**********@news.wave.co.nz...
Hi there,

I'm trying to create a query that will display all branches in a company
even if that branch hasn't made a claim. The main manufacturing company
makes the machines and distributes the machines to the other branches and it
is up to each branch to sell the machines to the customers. It is also the
branches responsibility to make sure the machine is registered when sold and
to deal with any warranty claims. The branch then sends all registration
details and warranty claims back to the manufacture where the manufacture
processes them.

On a monthly basis the manufacture creates reports and send them back to the
branch notifying them of the status of each claim submitted: credited, on
hold or declined. I've created this report in 2 ways, one as a standard
Access report and the other in Excel. It's the one created in Excel that
they use because it can be emailed easily and each branch manager can sort
the information to their own liking.

Not every branch sends in warranty claims but the manufacture wants the
reports to display all the branches even if they haven't made a claim, at
the moment they only display the branches that have made claims.

*tblBranch*
BranchID (PK) Autonumber
Branch

*tblMachines*
MachineID (PK) Autonumber
S/N
etc

*tblRegistrationDetails*
RegID (PK) Autonumber
MachineID (FK) one to one from tblMachines
BranchID (FK) one branch can register many machines
etc

*tblWarrantyClaims*
WarrID (PK) Autonumber
RegID (FK) one registration can have many claims
ClaimNo
ClaimDate
Status (FK) from tblstatus
etc

The overall table structure is a bit more complicated than this but how can
I display all branches in the reports even if the branch hasn't made a
claim? Report must show S/N, ClaimNo, Branch, ClaimDate, Status plus a few
more items from a WarrantyDetails table.

TIA
Stewart


Nov 12 '05 #2
Thanks Todd but it did not work, get ambiguous joins error message for both
the left outer and right outer joins. I tried all possible combinations of
right and left with all the tables.

Just a little correction to the table structure I'd posted it should be:
*tblBranch*
BranchID (PK) Autonumber
Branch

*tblMachines*
MachineID (PK) Autonumber
BranchID (FK) one branch can have many machines
S/N
etc

*tblRegistrationDetails*
RegID (PK) Autonumber
MachineID (FK) one to one from tblMachines
etc

*tblWarrantyClaims*
WarrID (PK) Autonumber
RegID (FK) one registration can have many claims
ClaimNo
ClaimDate
Status (FK) from tblstatus
etc

The change is the tblMachines has the BranchID so the manufacture can trace
who has been sent the machine even the machine hasn't been sold to a
customer. In me previous post I had the BranchID in the
tblRegistrationDetails.

Although my client has said he'd like all the branches to appear in the
reports but it won't be the end of the world if it doesn't happen. Situation
required; One branch can send in many warranty claims per month and each
warranty claim can only belong to one branch but not every branch sends in
claims every month. The reports are filtered via the claim date field to
find only the claims for that month. There is another table,
tblWarrantyDetails (parts, quantity, cost), as well but I can add that later
once I can get this part working first.

Does anybody have any other sugestions here?

Stewart
"Todd Shillam" <ts******@hotmail.com> wrote in message
news:xM********************@centurytel.net...
Stewart,

It appears like you need to use a left or right outer join in your report
query. If you use a left outer join, the query will display all records in the left table, even those without any related records in the right
table(s).

Best regards,

Todd


Nov 12 '05 #3
Sounds like you're trying to use two outer joins in the same query in
some way that the query interpreter doesn't like. You could probably
do this if you break this into separate queries.

Something like:
(1) find all the Warranty Claims for each Branch (Showing all
Branches, regardless of whether they have claims)

SELECT ...
FROM tblBranch LEFT JOIN tblRegistrationDetails AS RD ON
tblBranch.BranchID = RD.BranchID...

And then use that query in the second query and you should be good to
go. You can't do something like

TableA---LeftJoin---TableB--RightJoin---TableC

that's like a full outer join, which Oracle can do, but Access can't.
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Piet | last post by:
Hi there. I have a problem when working with a wxTreeCtrl. I would like to expand all branches of a sepcific position in a tree with a single command. Since there does not appear to be such a...
1
by: Dave Posh | last post by:
I seem to be having a problem displaying time stored in mysql. The format stored in the database is 13:15:05. The database data type is time. I'm using asp vbscript and sql to retrieve the time...
2
by: Carole MacDonald | last post by:
There have been lots of posts on this topic, but I haven't been able to apply any of the suggestions to my situation. I have an .aspx page with a form on it that has several submit buttons on...
5
by: Robert | last post by:
Hello Accessors I have some reports created in Access that are very good for what they do. However, it seems to me that when you are displaying information you don't need to print out that a...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
3
by: Alwin | last post by:
Hey All! I am currently designing a database model for (at first sight) a simple order entry program. The problem I'm currently facing is the exchange of data between the databases of each branch...
0
by: Nick 'The Database Guy' | last post by:
Despite the windy weather my driveway is still relatively unobstructed with folliage, so you might ask what is my problem. I am using the tree view active X control and was wondering the correct...
2
by: shar7 | last post by:
Hi, I am new to SQL and I need help to display null value as 0. Problem description: The query is to display Branch Code, Branch Location, Account Type Code, account Type Description and Total...
6
by: Jeff Newman | last post by:
Hello, Could anyone explain to me why the following class's destructor shows up as having multiple branches? (At least as judged by gcov 4.1.2 when compiled with gcc 4.1.2 ): struct blah {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.