A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Need All In Table To Show



 
 
Thread Tools Display Modes
  #1  
Old December 22nd, 2006, 12:28 PM posted to microsoft.public.access.queries
Welthey
external usenet poster
 
Posts: 52
Default Need All In Table To Show

I need to have all the departments in the department table to show whether
they have information in them or not. The query that I am using is

SELECT tblAllWorkLoggedRecords.Date, tblDepartment.Department,
Sum(tblAllWorkLoggedRecords.[VOLUME RECEIVED]) AS [SumOfVOLUME RECEIVED]
FROM tblAllWorkLoggedRecords RIGHT JOIN tblDepartment ON
tblAllWorkLoggedRecords.DEPARTMENT = tblDepartment.Department
GROUP BY tblAllWorkLoggedRecords.Date, tblDepartment.Department
HAVING (((tblAllWorkLoggedRecords.Date)=[Enter date: mm/dd/yyyy]));


I am getting the information that I need but it is only showing the
departments that actually have information but not showing the departments
that have zero

Any help would be great appreciated
  #2  
Old December 22nd, 2006, 01:35 PM posted to microsoft.public.access.queries
Jeff C
external usenet poster
 
Posts: 392
Default Need All In Table To Show

Right click on your "Join" between the two tables and choose properties,
select the "Show all records in tbl_Dept.

See if that works for you.
--
Jeff C
Live Well .. Be Happy In All You Do


"Welthey" wrote:

I need to have all the departments in the department table to show whether
they have information in them or not. The query that I am using is

SELECT tblAllWorkLoggedRecords.Date, tblDepartment.Department,
Sum(tblAllWorkLoggedRecords.[VOLUME RECEIVED]) AS [SumOfVOLUME RECEIVED]
FROM tblAllWorkLoggedRecords RIGHT JOIN tblDepartment ON
tblAllWorkLoggedRecords.DEPARTMENT = tblDepartment.Department
GROUP BY tblAllWorkLoggedRecords.Date, tblDepartment.Department
HAVING (((tblAllWorkLoggedRecords.Date)=[Enter date: mm/dd/yyyy]));


I am getting the information that I need but it is only showing the
departments that actually have information but not showing the departments
that have zero

Any help would be great appreciated

  #3  
Old December 22nd, 2006, 01:50 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Need All In Table To Show

Applying the criteria to the tblAllWorkLoggedRecords negates the right join.
Try the following which should return rows where
tblAllWorkLoggedRecords.Date is null as well as records where the date is a
match

SELECT tblAllWorkLoggedRecords.Date, tblDepartment.Department,
Sum(tblAllWorkLoggedRecords.[VOLUME RECEIVED]) AS [SumOfVOLUME RECEIVED]
FROM tblAllWorkLoggedRecords RIGHT JOIN tblDepartment ON
tblAllWorkLoggedRecords.DEPARTMENT = tblDepartment.Department
WHERE tblAllWorkLoggedRecords.Date=[Enter date: mm/dd/yyyy]
OR tblAllWorkLoggedRecords.Date is Null
GROUP BY tblAllWorkLoggedRecords.Date, tblDepartment.Department


"Welthey" wrote in message
...
I need to have all the departments in the department table to show whether
they have information in them or not. The query that I am using is

SELECT tblAllWorkLoggedRecords.Date, tblDepartment.Department,
Sum(tblAllWorkLoggedRecords.[VOLUME RECEIVED]) AS [SumOfVOLUME RECEIVED]
FROM tblAllWorkLoggedRecords RIGHT JOIN tblDepartment ON
tblAllWorkLoggedRecords.DEPARTMENT = tblDepartment.Department
GROUP BY tblAllWorkLoggedRecords.Date, tblDepartment.Department
HAVING (((tblAllWorkLoggedRecords.Date)=[Enter date: mm/dd/yyyy]));


I am getting the information that I need but it is only showing the
departments that actually have information but not showing the departments
that have zero

Any help would be great appreciated



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.