Options

Index with ascending and descending fields

AdriAdri Member Posts: 8

I want to create an index with 2 ascending fields and 1 descending field. Is this possible?

Best Answer

Answers

  • Options
    Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    No, I'm afraid, not possible.

    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • Options
    KishormKishorm Member Posts: 921
    Yes, you can do this in later versions of NAV (2016 onwards) by using the SETASCENDING function...

    https://msdn.microsoft.com/en-us/library/mt574426(v=nav.90).aspx
  • Options
    Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Upps, didn't know that :blush:
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • Options
    jaclynjaclyn Member Posts: 56
    Yes You can use ASCENDING function on any field, you just need to create a key for that field and then use SETCURRENTKEY function on the field before you use ASCENDING on that field.

    [Ascending :=]Record.SETASCENDING(Field,[ SetAscending])

    Customer.SETCURRENTKEY(City,"Name");
    Customer.SETASCENDING(City,Descending);
Sign In or Register to comment.