Search code examples
datetimeaxaptax++dynamics-ax-2012-r3

choose record which have max value of createdDateTime ax2012


I'm writing a select statement,

I want to choose record which createdDateTime value is nearest.

For example

I want to choose second line, because it has max value.

How can i add this condition in my select statement?


Solution

  • Please check the example below:

    Table   table;
    ;
    
    select firstOnly table
        order by table.createdDateTime desc;
    

    Select Statement Syntax