web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Date function like Month,Year in sql query

(0) ShareShare
ReportReport
Posted on by 2,055

Hi All,

I am using AX 2012 CU7. I was trying to find the month, year function in X++ SQL, but no luck. Actually I have to develop a customize, customer monthly sale report. For this report I was finding the month, year function in SQL. Is there any function so I can write a query like we can in the follwoing way SQL.

seelect * from MyTable where month(MyDate)="06"

OR

I need the following Pattern of the report in AX, if any one can help to develop this report.

0250.report.png

*This post is locked for comments

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at

    Hi Nadeem,

    This is not supported in this way. All options for x++ select statements are described on the next page: msdn.microsoft.com/.../aa656402.aspx.

    You can create a temporary table having the separate columns. Then fill this temporary table with a data provider class like you want to print it.

    You can loop the original table and then fill the temporary table per record.

  • Suggested answer
    Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    You can't find SQL functions in X++, because these are two different languages. You seems to  be looking for equivalent functions supported in X++ queries, but they don't exist.

    One option is fetching dates from database and convert them to month numbers in X++, as André suggested. Another approach is using SQL (where you obviously can use SQL function) - the best way is utilizing computed columns.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans