Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

AX 2012 how to make the monthly summary use AOT Query and Form

Posted on by 305

Hello All,

I need make the monthly summary in AX.

SQL is :

select Year(IQ.QUARANTINEDATE) as 'Year',MONTH(IQ.QUARANTINEDATE) as 'Month',SUM(QTY) as 'SUM QTY'
from INVENTQUARANTINEORDER as IQ
where Year(IQ.QUARANTINEDATE) = Year(GETDATE())
group by Year(IQ.QUARANTINEDATE) ,MONTH(IQ.QUARANTINEDATE)
order by Year(IQ.QUARANTINEDATE) ,MONTH(IQ.QUARANTINEDATE)

I had no idea how to do.

Please help and thank you.

Below is I think:

in AOT Query create 2 custom field: Year(date) and Month(date)

and sum(qty)

Group by and order by Year(date),Month(day)

but.....I can't find way to do this...

*This post is locked for comments

  • Mark Boy2 Profile Picture
    Mark Boy2 490 on at
    RE: AX 2012 how to make the monthly summary use AOT Query and Form

    you can create a new temporarytable have a month field and Insert data from the inventquarantineorder table .  

    select temporarytable

    where xxxxxxxxxxxxxxxxx

    group by mounth

    in ax you can use buf2buf () to shared your data for different table.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,269 Super User 2024 Season 2 on at
    RE: AX 2012 how to make the monthly summary use AOT Query and Form

    Hi Atma,

    The select with a function to get part of a date is not working in this way. You can try creating a view with computed columns. Thos.computed columns can handle T-SQL

  • ATMA-Jen Profile Picture
    ATMA-Jen 305 on at
    RE: AX 2012 how to make the monthly summary use AOT Query and Form

    Like:

    Date                Qty

    2019/01          100

    2019/02           135

    2019/03            125

    or

    Year      month                Qty

    2019       01                      100

    2019       02                       135

    2019        03                       125

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans