Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Inventory movement query for SQL

Posted on by Microsoft Employee

Hey Everyone

Is there any SQL qeury

Complete inventory movement  FY 2018 with below fields extracted from database ( with query used for extraction ) for assessment

 

  • Item Number / Description
  • Type of movement (Purchase , Sales, Issuance or Transfer )
  • Date  of movement
  • Amount
  • Quantity
  • Opening Balance of the inventory item as of 1st Jan 2018
  • Closing Balance as of 31st Dec 2018

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Inventory movement query for SQL

    we are using AX 2012 R3 cu9

  • Suggested answer
    ColbyGallagher Profile Picture
    ColbyGallagher 3,664 on at
    RE: Inventory movement query for SQL

    Everything but the Opening balance and closing balances can be retrieved from InventTable joined to InventTrans.   What version of AX are you on?  If you are using 2012 R2 or later, the inventory value cube will provide everything you are asking for.  

  • Suggested answer
    MATTGUO Profile Picture
    MATTGUO 22,306 on at
    RE: Inventory movement query for SQL

    Hi geeirfan,

    Query in sql:

    select a.ItemId,a.DatePhysical,a.COSTAMOUNTPHYSICAL,a.DATEFINANCIAL,a.COSTAMOUNTPOSTED

    ,a.qty,

    case when b.REFERENCECATEGORY='0' then 'salesr'

    when b.REFERENCECATEGORY='3' then 'purchase'

    when b.REFERENCECATEGORY='6' then 'Transfer'

    else 'others' end as Type

    from InventTrans a

    left join InventTransOrigin b on a.itemid=b.itemid and a.InventTransOrigin=b.RecId

    where a.DatePhysical between '2018-01-01 00:00:00.000' and '2018-12-31 00:00:00.000'

    and a.itemid='*****' and a.DATAAREAid='******'

    For the balance, you can use inventory values report in system.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans