Need help creating a query.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jabberwocky75
    New Member
    • Jan 2009
    • 3

    Need help creating a query.

    I am trying to create an On Hand column for an inventory report. I have been all over the web and the solutions offered seem overly complex. All I need is a simple query for 'UnitsReceived (minus) UnitsSold' but I can't seem to get it to work no matter how I phrase it.
    Table is 'Inventory Transactions'
    Fields are 'UnitsReceived' and 'UnitsSold'
    Thanks in advance.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    can you please post the query that you are working on .

    Comment

    • jabberwocky75
      New Member
      • Jan 2009
      • 3

      #3
      Maybe query isn't the right term, I need an expression to enter as the source for the report. I have tried things such as =[UnitsReceived]-{UnitsSold], and just about every variation I can think of and it just returns blank spaces on the report. I know I am missing something but I don't know what. My inventory report lists all the products in the database along with their info (suppliers, product id, reorder level, etc.) My intent is to use this report to look at my products and compare reorder levels to onhand qty to see what needs ordering.
      Thanks.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32653

        #4
        Originally posted by jabberwocky75
        Maybe query isn't the right term, ...
        I suspect it is however.

        In Access, a report is based on a record source of some kind. It's true that it is also possible to do some manipulation of results within the design of the report itself, but as a simple rule of thumb - if it can be done within the record source (generally a query though tables also work) then it is advisable to do so.

        If we had some more details then we would be in a better position to help, but from what you have posted I would suggest something like the following be included in the SQL of your query (the record source) :
        Code:
        SELECT ...,
               [UnitsReceived]-[UnitsSold] AS UnitsAvailable,
               ...
        FROM [Inventory Transactions]
        ...
        Welcome to Bytes!

        Comment

        • jabberwocky75
          New Member
          • Jan 2009
          • 3

          #5
          Thanks for the help, I have resolved my problem. It all came down to a faulty understanding of query building.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32653

            #6
            Glad to hear it. And thanks for posting back :)

            Comment

            Working...