Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    In case you have not solved above syntax issue, try doing it in the Query Design Grid.

    Just a small thing, by Current Balance, I assume Balance which is available for Issuing :
    Nz([SumofQtyIn],0)+Nz([SumQtyReturn])-Nz([SumQtyIssued],0) AS CurrentBalance,
    CurrentBalance = SumofQtyIn + SumQtyReurn - SumQtyIssued;



    SumQtyReurn - Here it should be reflecting the Good Qty Returned ( excluding the Bad Qty Returned ) & not the Total Qty Returned.

    Thanks

  2. #17
    braveali is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    31
    Hi,

    This below qry works fine for me, all i need is to add the information for the DeadItem in qryAvailableBalace, because this Query is showing all the information related to Stock,
    I tried but couldn't get it, I will appreciate if you please guide me how should i write some statement to add a field in qryAvailableBalance under this coding: (Thanks)

    SELECT
    tblItems.ItemID,
    tblItems.ItemName,
    tblItems.ReOrderLevel,
    Nz([SumofQtyIn],0) AS TotalQtyIn,
    Nz([SumQtyReturn],0) AS TotalQtyReturned,
    Nz([SumQtyIssued],0) AS TotalQtyIssued,
    Nz([SumofQtyIn],0)+Nz([SumQtyReturn])-Nz([SumQtyIssued],0) AS CurrentBalance,
    IIf([CurrentBalance]<=[ReOrderLevel],"Place Order","Stock level is OK") AS ReOrderStatus
    FROM
    ( ( tblItems LEFT JOIN qrySumofStockIN ON tblItems.ItemID = qrySumofStockIN.ItemID)
    LEFT JOIN
    qryTotalReturn ON tblItems.ItemID = qryTotalReturn.ItemID)
    LEFT JOIN
    qrySumofStockOut ON tblItems.ItemID = qrySumofStockOut.ItemID;





    QryTotalReturn
    ItemID SumQtyReturn
    Antiviurs 1

    QryDeadItemReturn
    ItemID QtySumDeadReturn
    Antiviurs 1
    Desktop Computer 2


    QryAvailableBalance
    ItemID ItemName ReOrderLevel TotalQtyIn TotalQtyReturned TotalQtyIssued CurrentBalance ReOrderStatus
    1 Antiviurs 0 20 1 4 17 Stock level is OK
    2 Desktop Computer 0 10 0 5 5 Stock level is OK
    3 CD-R 0 20 0 0 20 Stock level is OK
    4 CD-RW 0 0 0 0 0 Place Order
    5 DVD-R 0 0 0 0 0 Place Order
    6 DVD-RW 0 20 0 0 20 Stock level is OK

  3. #18
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Make a copy of your query
    qryAvailableBalance .

    Give it a name, let us say - qryAvailableBalanceWithDeadStock.

    Open this Query in Design View.

    Add the query QryDeadItemReturn to this Design Grid.
    Join the tblItems ItemID to QryDeadItemReturn ItemID.
    Right Click the Join & convert it in to a Left Join by selecting probably, the 2nd option which will be something like "Include all records from tblItems & all records from QryDeadItemReturn where the joined fields are same".

    Add the field QtySumDeadReturn from QryDeadItemReturn to the Query fields. If you want a 0 to appear instead of blank fields, use Nz(QtySumDeadReturn, 0).

    Now run the query. If it runs fine, take a look at the SQL Design of the Query.

    Thanks

  4. #19
    braveali is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    31
    Thanks a lot for helping me in this, I have learned a lot from your guidelines.

  5. #20
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Glad we could help.

    Thanks

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 02-02-2012, 12:18 PM
  2. expression builder
    By tonyl in forum Access
    Replies: 3
    Last Post: 11-26-2011, 12:00 AM
  3. Replies: 1
    Last Post: 11-17-2011, 12:06 PM
  4. subtraction between records
    By JJCHCK in forum Programming
    Replies: 5
    Last Post: 10-11-2011, 12:57 AM
  5. Code Builder
    By nkenney in forum Forms
    Replies: 3
    Last Post: 11-04-2009, 10:58 AM

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