How do I exclude records that will sum to zero in a report? in Access Database Reports  
 |  Edit my Profile  |  Help
 
     
  
 
 
 
samiam 9/11/2007 3:09 PM PST
  Question
  I have a report based on a query. I would like to exclude the items in the
report that sum to zero in order to shorten my report and remove those items
that have been "used." How do I exclude the detail records that will sum to
zero in my report?
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
KARL DEWEY 9/11/2007 3:50 PM PST
   
  Use criteria in your totals query <> 0 and it not pull them.
--
KARL DEWEY
Build a little - Test a little


"samiam" wrote:

> I have a report based on a query. I would like to exclude the items in the
> report that sum to zero in order to shorten my report and remove those items
> that have been "used." How do I exclude the detail records that will sum to
> zero in my report?
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
samiam 9/11/2007 4:16 PM PST
   
  Karl:

My query includes a column where quantity * weight is placed. This always
has a number in it. What I'm trying to do is if the summation of this column
for a product is zero, exclude that product from the report. I've tried <>0,
but I still get zero result products sent to the report.

samiam

"KARL DEWEY" wrote:

> Use criteria in your totals query <> 0 and it not pull them.
> --
> KARL DEWEY
> Build a little - Test a little
>
>
> "samiam" wrote:
>
> > I have a report based on a query. I would like to exclude the items in the
> > report that sum to zero in order to shorten my report and remove those items
> > that have been "used." How do I exclude the detail records that will sum to
> > zero in my report?
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
KARL DEWEY 9/11/2007 4:32 PM PST
   
  Post the SQL of your query.
--
KARL DEWEY
Build a little - Test a little


"samiam" wrote:

> Karl:
>
> My query includes a column where quantity * weight is placed. This always
> has a number in it. What I'm trying to do is if the summation of this column
> for a product is zero, exclude that product from the report. I've tried <>0,
> but I still get zero result products sent to the report.
>
> samiam
>
> "KARL DEWEY" wrote:
>
> > Use criteria in your totals query <> 0 and it not pull them.
> > --
> > KARL DEWEY
> > Build a little - Test a little
> >
> >
> > "samiam" wrote:
> >
> > > I have a report based on a query. I would like to exclude the items in the
> > > report that sum to zero in order to shorten my report and remove those items
> > > that have been "used." How do I exclude the detail records that will sum to
> > > zero in my report?
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
samiam 9/12/2007 9:03 AM PST
   
  Here is my SQL query:

SELECT tblInventory.CustomerID, tblCustomer.ShortName, tblCustomer.FullName,
IIf([TransTypeID]=1,[RecDate],IIf([TransTypeID]=2,[BOLDate],IIf([TransTypeID]=3,[MoveDate],[ADJDate])))
AS TransDate, tblInventory.ID,
IIf([TransTypeID]=1,"Receiving",IIf([TransTypeID]=2,"BOL",IIf([TransTypeID]=3,"Move","Adjustment")))
AS TransTypeName, tblAisle.Name AS Aisle, tblInventory.CustPO,
tblInventory.Quantity, tblProduct.uID, tblProduct.ProductCode,
tblProduct.Description, tblProduct.NWeight, tblInventory.DayCode,
([QUANTITY]*[NWEIGHT]) AS NETWEIGHT
FROM tblCustomer INNER JOIN (tblAisle RIGHT JOIN ((tblMoveInv RIGHT JOIN
(tblInvAdj RIGHT JOIN (tblReceiving RIGHT JOIN (tblBOL RIGHT JOIN
tblInventory ON tblBOL.BOLNo = tblInventory.ID) ON tblReceiving.uID =
tblInventory.ID) ON tblInvAdj.uID = tblInventory.ID) ON tblMoveInv.uID =
tblInventory.ID) INNER JOIN tblProduct ON tblInventory.ProductID =
tblProduct.uID) ON tblAisle.uID = tblInventory.AisleID) ON tblCustomer.uID =
tblInventory.CustomerID
WHERE (((tblCustomer.ShortName) Like "NESTLE"))
ORDER BY tblInventory.CustomerID, tblInventory.CustPO,
tblProduct.ProductCode, tblInventory.MoveOrder;

I appreciate your assistance.
samiam

"KARL DEWEY" wrote:

> Post the SQL of your query.
> --
> KARL DEWEY
> Build a little - Test a little
>
>
> "samiam" wrote:
>
> > Karl:
> >
> > My query includes a column where quantity * weight is placed. This always
> > has a number in it. What I'm trying to do is if the summation of this column
> > for a product is zero, exclude that product from the report. I've tried <>0,
> > but I still get zero result products sent to the report.
> >
> > samiam
> >
> > "KARL DEWEY" wrote:
> >
> > > Use criteria in your totals query <> 0 and it not pull them.
> > > --
> > > KARL DEWEY
> > > Build a little - Test a little
> > >
> > >
> > > "samiam" wrote:
> > >
> > > > I have a report based on a query. I would like to exclude the items in the
> > > > report that sum to zero in order to shorten my report and remove those items
> > > > that have been "used." How do I exclude the detail records that will sum to
> > > > zero in my report?
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Duane Hookom  9/12/2007 9:53 AM PST
  Answer
  I would create a totals query like:

SELECT tblInventory.ID
FROM tblCustomer INNER JOIN tblInventory ON tblCustomer.uID =
tblInventory.CustomerID
WHERE tblCustomer.ShortName Like "NESTLE"
GROUP BY tblInventory.ID
HAVING Sum(Quantity) <> 0;

Then add this query to your report's query and join the ID fields. This
should limit the report to IDs where the quantity is not 0.

Apparently you work for one of our suppliers (I work for Nestle ;-)

--
Duane Hookom
Microsoft Access MVP


"samiam" wrote:

> Here is my SQL query:
>
> SELECT tblInventory.CustomerID, tblCustomer.ShortName, tblCustomer.FullName,
> IIf([TransTypeID]=1,[RecDate],IIf([TransTypeID]=2,[BOLDate],IIf([TransTypeID]=3,[MoveDate],[ADJDate])))
> AS TransDate, tblInventory.ID,
> IIf([TransTypeID]=1,"Receiving",IIf([TransTypeID]=2,"BOL",IIf([TransTypeID]=3,"Move","Adjustment")))
> AS TransTypeName, tblAisle.Name AS Aisle, tblInventory.CustPO,
> tblInventory.Quantity, tblProduct.uID, tblProduct.ProductCode,
> tblProduct.Description, tblProduct.NWeight, tblInventory.DayCode,
> ([QUANTITY]*[NWEIGHT]) AS NETWEIGHT
> FROM tblCustomer INNER JOIN (tblAisle RIGHT JOIN ((tblMoveInv RIGHT JOIN
> (tblInvAdj RIGHT JOIN (tblReceiving RIGHT JOIN (tblBOL RIGHT JOIN
> tblInventory ON tblBOL.BOLNo = tblInventory.ID) ON tblReceiving.uID =
> tblInventory.ID) ON tblInvAdj.uID = tblInventory.ID) ON tblMoveInv.uID =
> tblInventory.ID) INNER JOIN tblProduct ON tblInventory.ProductID =
> tblProduct.uID) ON tblAisle.uID = tblInventory.AisleID) ON tblCustomer.uID =
> tblInventory.CustomerID
> WHERE (((tblCustomer.ShortName) Like "NESTLE"))
> ORDER BY tblInventory.CustomerID, tblInventory.CustPO,
> tblProduct.ProductCode, tblInventory.MoveOrder;
>
> I appreciate your assistance.
> samiam
>
> "KARL DEWEY" wrote:
>
> > Post the SQL of your query.
> > --
> > KARL DEWEY
> > Build a little - Test a little
> >
> >
> > "samiam" wrote:
> >
> > > Karl:
> > >
> > > My query includes a column where quantity * weight is placed. This always
> > > has a number in it. What I'm trying to do is if the summation of this column
> > > for a product is zero, exclude that product from the report. I've tried <>0,
> > > but I still get zero result products sent to the report.
> > >
> > > samiam
> > >
> > > "KARL DEWEY" wrote:
> > >
> > > > Use criteria in your totals query <> 0 and it not pull them.
> > > > --
> > > > KARL DEWEY
> > > > Build a little - Test a little
> > > >
> > > >
> > > > "samiam" wrote:
> > > >
> > > > > I have a report based on a query. I would like to exclude the items in the
> > > > > report that sum to zero in order to shorten my report and remove those items
> > > > > that have been "used." How do I exclude the detail records that will sum to
> > > > > zero in my report?
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
samiam 9/12/2007 12:36 PM PST
   
  I work at Payson Fruit Growers in Payson, UT. We store products for you.

Thanks a bunch.

samiam

"Duane Hookom" wrote:

> I would create a totals query like:
>
> SELECT tblInventory.ID
> FROM tblCustomer INNER JOIN tblInventory ON tblCustomer.uID =
> tblInventory.CustomerID
> WHERE tblCustomer.ShortName Like "NESTLE"
> GROUP BY tblInventory.ID
> HAVING Sum(Quantity) <> 0;
>
> Then add this query to your report's query and join the ID fields. This
> should limit the report to IDs where the quantity is not 0.
>
> Apparently you work for one of our suppliers (I work for Nestle ;-)
>
> --
> Duane Hookom
> Microsoft Access MVP
>
>
> "samiam" wrote:
>
> > Here is my SQL query:
> >
> > SELECT tblInventory.CustomerID, tblCustomer.ShortName, tblCustomer.FullName,
> > IIf([TransTypeID]=1,[RecDate],IIf([TransTypeID]=2,[BOLDate],IIf([TransTypeID]=3,[MoveDate],[ADJDate])))
> > AS TransDate, tblInventory.ID,
> > IIf([TransTypeID]=1,"Receiving",IIf([TransTypeID]=2,"BOL",IIf([TransTypeID]=3,"Move","Adjustment")))
> > AS TransTypeName, tblAisle.Name AS Aisle, tblInventory.CustPO,
> > tblInventory.Quantity, tblProduct.uID, tblProduct.ProductCode,
> > tblProduct.Description, tblProduct.NWeight, tblInventory.DayCode,
> > ([QUANTITY]*[NWEIGHT]) AS NETWEIGHT
> > FROM tblCustomer INNER JOIN (tblAisle RIGHT JOIN ((tblMoveInv RIGHT JOIN
> > (tblInvAdj RIGHT JOIN (tblReceiving RIGHT JOIN (tblBOL RIGHT JOIN
> > tblInventory ON tblBOL.BOLNo = tblInventory.ID) ON tblReceiving.uID =
> > tblInventory.ID) ON tblInvAdj.uID = tblInventory.ID) ON tblMoveInv.uID =
> > tblInventory.ID) INNER JOIN tblProduct ON tblInventory.ProductID =
> > tblProduct.uID) ON tblAisle.uID = tblInventory.AisleID) ON tblCustomer.uID =
> > tblInventory.CustomerID
> > WHERE (((tblCustomer.ShortName) Like "NESTLE"))
> > ORDER BY tblInventory.CustomerID, tblInventory.CustPO,
> > tblProduct.ProductCode, tblInventory.MoveOrder;
> >
> > I appreciate your assistance.
> > samiam
> >
> > "KARL DEWEY" wrote:
> >
> > > Post the SQL of your query.
> > > --
> > > KARL DEWEY
> > > Build a little - Test a little
> > >
> > >
> > > "samiam" wrote:
> > >
> > > > Karl:
> > > >
> > > > My query includes a column where quantity * weight is placed. This always
> > > > has a number in it. What I'm trying to do is if the summation of this column
> > > > for a product is zero, exclude that product from the report. I've tried <>0,
> > > > but I still get zero result products sent to the report.
> > > >
> > > > samiam
> > > >
> > > > "KARL DEWEY" wrote:
> > > >
> > > > > Use criteria in your totals query <> 0 and it not pull them.
> > > > > --
> > > > > KARL DEWEY
> > > > > Build a little - Test a little
> > > > >
> > > > >
> > > > > "samiam" wrote:
> > > > >
> > > > > > I have a report based on a query. I would like to exclude the items in the
> > > > > > report that sum to zero in order to shorten my report and remove those items
> > > > > > that have been "used." How do I exclude the detail records that will sum to
> > > > > > zero in my report?
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
samiam 9/12/2007 1:00 PM PST
   
  Duane:

Should the HAVING clause include quantity times new weight, or just quantity?

samiam

"Duane Hookom" wrote:

> I would create a totals query like:
>
> SELECT tblInventory.ID
> FROM tblCustomer INNER JOIN tblInventory ON tblCustomer.uID =
> tblInventory.CustomerID
> WHERE tblCustomer.ShortName Like "NESTLE"
> GROUP BY tblInventory.ID
> HAVING Sum(Quantity) <> 0;
>
> Then add this query to your report's query and join the ID fields. This
> should limit the report to IDs where the quantity is not 0.
>
> Apparently you work for one of our suppliers (I work for Nestle ;-)
>
> --
> Duane Hookom
> Microsoft Access MVP
>
>
> "samiam" wrote:
>
> > Here is my SQL query:
> >
> > SELECT tblInventory.CustomerID, tblCustomer.ShortName, tblCustomer.FullName,
> > IIf([TransTypeID]=1,[RecDate],IIf([TransTypeID]=2,[BOLDate],IIf([TransTypeID]=3,[MoveDate],[ADJDate])))
> > AS TransDate, tblInventory.ID,
> > IIf([TransTypeID]=1,"Receiving",IIf([TransTypeID]=2,"BOL",IIf([TransTypeID]=3,"Move","Adjustment")))
> > AS TransTypeName, tblAisle.Name AS Aisle, tblInventory.CustPO,
> > tblInventory.Quantity, tblProduct.uID, tblProduct.ProductCode,
> > tblProduct.Description, tblProduct.NWeight, tblInventory.DayCode,
> > ([QUANTITY]*[NWEIGHT]) AS NETWEIGHT
> > FROM tblCustomer INNER JOIN (tblAisle RIGHT JOIN ((tblMoveInv RIGHT JOIN
> > (tblInvAdj RIGHT JOIN (tblReceiving RIGHT JOIN (tblBOL RIGHT JOIN
> > tblInventory ON tblBOL.BOLNo = tblInventory.ID) ON tblReceiving.uID =
> > tblInventory.ID) ON tblInvAdj.uID = tblInventory.ID) ON tblMoveInv.uID =
> > tblInventory.ID) INNER JOIN tblProduct ON tblInventory.ProductID =
> > tblProduct.uID) ON tblAisle.uID = tblInventory.AisleID) ON tblCustomer.uID =
> > tblInventory.CustomerID
> > WHERE (((tblCustomer.ShortName) Like "NESTLE"))
> > ORDER BY tblInventory.CustomerID, tblInventory.CustPO,
> > tblProduct.ProductCode, tblInventory.MoveOrder;
> >
> > I appreciate your assistance.
> > samiam
> >
> > "KARL DEWEY" wrote:
> >
> > > Post the SQL of your query.
> > > --
> > > KARL DEWEY
> > > Build a little - Test a little
> > >
> > >
> > > "samiam" wrote:
> > >
> > > > Karl:
> > > >
> > > > My query includes a column where quantity * weight is placed. This always
> > > > has a number in it. What I'm trying to do is if the summation of this column
> > > > for a product is zero, exclude that product from the report. I've tried <>0,
> > > > but I still get zero result products sent to the report.
> > > >
> > > > samiam
> > > >
> > > > "KARL DEWEY" wrote:
> > > >
> > > > > Use criteria in your totals query <> 0 and it not pull them.
> > > > > --
> > > > > KARL DEWEY
> > > > > Build a little - Test a little
> > > > >
> > > > >
> > > > > "samiam" wrote:
> > > > >
> > > > > > I have a report based on a query. I would like to exclude the items in the
> > > > > > report that sum to zero in order to shorten my report and remove those items
> > > > > > that have been "used." How do I exclude the detail records that will sum to
> > > > > > zero in my report?
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Duane Hookom  9/12/2007 2:27 PM PST
   
  I don't know your data so you need to decide if the weight is significant. I
assumed the quantity was really the only required value.

--
Duane Hookom
Microsoft Access MVP


"samiam" wrote:

> Duane:
>
> Should the HAVING clause include quantity times new weight, or just quantity?
>
> samiam
>
> "Duane Hookom" wrote:
>
> > I would create a totals query like:
> >
> > SELECT tblInventory.ID
> > FROM tblCustomer INNER JOIN tblInventory ON tblCustomer.uID =
> > tblInventory.CustomerID
> > WHERE tblCustomer.ShortName Like "NESTLE"
> > GROUP BY tblInventory.ID
> > HAVING Sum(Quantity) <> 0;
> >
> > Then add this query to your report's query and join the ID fields. This
> > should limit the report to IDs where the quantity is not 0.
> >
> > Apparently you work for one of our suppliers (I work for Nestle ;-)
> >
> > --
> > Duane Hookom
> > Microsoft Access MVP
> >
> >
> > "samiam" wrote:
> >
> > > Here is my SQL query:
> > >
> > > SELECT tblInventory.CustomerID, tblCustomer.ShortName, tblCustomer.FullName,
> > > IIf([TransTypeID]=1,[RecDate],IIf([TransTypeID]=2,[BOLDate],IIf([TransTypeID]=3,[MoveDate],[ADJDate])))
> > > AS TransDate, tblInventory.ID,
> > > IIf([TransTypeID]=1,"Receiving",IIf([TransTypeID]=2,"BOL",IIf([TransTypeID]=3,"Move","Adjustment")))
> > > AS TransTypeName, tblAisle.Name AS Aisle, tblInventory.CustPO,
> > > tblInventory.Quantity, tblProduct.uID, tblProduct.ProductCode,
> > > tblProduct.Description, tblProduct.NWeight, tblInventory.DayCode,
> > > ([QUANTITY]*[NWEIGHT]) AS NETWEIGHT
> > > FROM tblCustomer INNER JOIN (tblAisle RIGHT JOIN ((tblMoveInv RIGHT JOIN
> > > (tblInvAdj RIGHT JOIN (tblReceiving RIGHT JOIN (tblBOL RIGHT JOIN
> > > tblInventory ON tblBOL.BOLNo = tblInventory.ID) ON tblReceiving.uID =
> > > tblInventory.ID) ON tblInvAdj.uID = tblInventory.ID) ON tblMoveInv.uID =
> > > tblInventory.ID) INNER JOIN tblProduct ON tblInventory.ProductID =
> > > tblProduct.uID) ON tblAisle.uID = tblInventory.AisleID) ON tblCustomer.uID =
> > > tblInventory.CustomerID
> > > WHERE (((tblCustomer.ShortName) Like "NESTLE"))
> > > ORDER BY tblInventory.CustomerID, tblInventory.CustPO,
> > > tblProduct.ProductCode, tblInventory.MoveOrder;
> > >
> > > I appreciate your assistance.
> > > samiam
> > >
> > > "KARL DEWEY" wrote:
> > >
> > > > Post the SQL of your query.
> > > > --
> > > > KARL DEWEY
> > > > Build a little - Test a little
> > > >
> > > >
> > > > "samiam" wrote:
> > > >
> > > > > Karl:
> > > > >
> > > > > My query includes a column where quantity * weight is placed. This always
> > > > > has a number in it. What I'm trying to do is if the summation of this column
> > > > > for a product is zero, exclude that product from the report. I've tried <>0,
> > > > > but I still get zero result products sent to the report.
> > > > >
> > > > > samiam
> > > > >
> > > > > "KARL DEWEY" wrote:
> > > > >
> > > > > > Use criteria in your totals query <> 0 and it not pull them.
> > > > > > --
> > > > > > KARL DEWEY
> > > > > > Build a little - Test a little
> > > > > >
> > > > > >
> > > > > > "samiam" wrote:
> > > > > >
> > > > > > > I have a report based on a query. I would like to exclude the items in the
> > > > > > > report that sum to zero in order to shorten my report and remove those items
> > > > > > > that have been "used." How do I exclude the detail records that will sum to
> > > > > > > zero in my report?
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Duane Hookom  9/11/2007 7:48 PM PST
   
  You must create/calculate your totals in the report's record source. Make a
query similar to your report's record source:
SELECT Product
FROM tblNoNameGiven
GROUP BY Product
HAVING Sum(Quantity * Weight)<>0;

Add this query to your report's record source query and join the Product
fields.

--
Duane Hookom
Microsoft Access MVP


"samiam" wrote:

> Karl:
>
> My query includes a column where quantity * weight is placed. This always
> has a number in it. What I'm trying to do is if the summation of this column
> for a product is zero, exclude that product from the report. I've tried <>0,
> but I still get zero result products sent to the report.
>
> samiam
>
> "KARL DEWEY" wrote:
>
> > Use criteria in your totals query <> 0 and it not pull them.
> > --
> > KARL DEWEY
> > Build a little - Test a little
> >
> >
> > "samiam" wrote:
> >
> > > I have a report based on a query. I would like to exclude the items in the
> > > report that sum to zero in order to shorten my report and remove those items
> > > that have been "used." How do I exclude the detail records that will sum to
> > > zero in my report?
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
  Return to Microsoft Communities  Notify me of replies