Options

how do i retrieve a value with the most count?

rocfrocf Member Posts: 4
edited 2003-01-27 in Navision Attain
Hi all,

I am new and I am desperate! :)

I have a range of dates in a field in a table, and I need to retrieve the value with the highest number of counts, how do I do that in C/AL? Getrangemax will only give me the highest value....
TIA!

rocf

Comments

  • Options
    jyotsnasjyotsnas Member Posts: 62
    Hi rocf

    GETRANGEMAX will give you the upper end of the range for a record. The following code will give you the count for that range.
       Rec.GETRANGEMAX( RangeField ) - Rec.GETRANGEMIN( RangeField )
    

    If you repeat this in loop, with some additional logic you will get the widest range of all

    Regards,

    Jyotsna
    ______Doubt is the father of Invension_______
Sign In or Register to comment.