Results 1 to 3 of 3
  1. #1
    jordanturner is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2010
    Location
    Burnley, England
    Posts
    32

    Displaying a null value as 0

    Hi all,

    I am very nearly finished my first stock control database but I still have a couple of problems. I have a report that runs a calculation for stock quantity on hand. The calculation looks through the transactions table and sums all received - all dispatched +returns. The report works fine apart from if an item has not had a transaction, then it does not show on the report. I would like the report to show the item as 0 rather then not appear at all.


    The SQL for the report is:


    SELECT DISTINCTROW tblSupplier.SupplierID, tblSupplier.CompanyName, Sum(nz([QuantityReceived])-nz([QuantityDispatched]-nz(QuantityReturned))) AS [Units in Stock], tblStock.ItemName, tblStock.StockID
    FROM tblSupplier INNER JOIN (tblStock INNER JOIN tblInventoryTransactions ON tblStock.StockID = tblInventoryTransactions.StockID) ON tblSupplier.SupplierID = tblStock.SupplierID
    GROUP BY tblSupplier.SupplierID, tblSupplier.CompanyName, tblStock.ItemName, tblStock.StockID;

    Any help would be greatly appreciated.

    Thanks

    Jordan T

  2. #2
    Cullen1109 is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    6
    SELECT qryStockDate2.StockID, qryStockDate2.ItemName, IIf(IsNull([qryStockDate].[LastStock]),0,[qryStockDate].[LastStock]) AS LastStock, qryStockDate2.NewStock, qryStockDate2.SupplierID
    FROM qryStockDate RIGHT JOIN qryStockDate2 ON qryStockDate.StockID=qryStockDate2.StockID;

    Using that sort of idea help after our little chat?
    Solved!

  3. #3
    jordanturner is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2010
    Location
    Burnley, England
    Posts
    32
    Thanks, you are a genius!!!! You should be an admin

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query not displaying value
    By cwwaicw311 in forum Queries
    Replies: 5
    Last Post: 03-22-2010, 10:11 AM
  2. Displaying Value and not ID
    By jonny in forum Access
    Replies: 3
    Last Post: 10-19-2009, 08:21 AM
  3. Displaying Time Only
    By Corinne in forum Access
    Replies: 5
    Last Post: 06-24-2009, 09:45 PM
  4. displaying the time 12:00:00 AM
    By kfoyil in forum Access
    Replies: 4
    Last Post: 12-05-2006, 11:02 PM
  5. Displaying a PDF in a Form
    By Chaz in forum Forms
    Replies: 0
    Last Post: 08-07-2006, 03:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums