[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

How to inquire top some(Ex:10)?

crane

2/13/2006 9:43:00 AM

I need inquire top 10 from table order by Qty,How to inquire ?
Thanks!
2 Answers

Anton Venter

2/13/2006 6:43:00 PM

0

There is way to do this directly using X++. You can however use a while
select or you can use a UserConnection. See the developer's guide for an
example.



"crane" <crane@discussions.microsoft.com> wrote in message
news:E0D23379-729C-44DF-A1A7-A97308913B50@microsoft.com...
>I need inquire top 10 from table order by Qty,How to inquire ?
> Thanks!


Vishal

2/15/2006 10:01:00 AM

0

U can chk this code here for getting Top 10 records, there is no syntax in
X++ for getting Top 10 records so we used a counter for the same.

static void Top10(Args _args)
{
InventSum lInventSum;
Counter lCtr;
;

WHILE SELECT ItemId, sum(AvailPhysical) FROM lInventSum
GROUP BY ItemId
{
if(lCtr == 10)
break;
print lInventSum.ItemId, ' ', lInventSum.AvailPhysical;
lCtr++;
}
pause;
}

--
Vishal



"crane" wrote:

> I need inquire top 10 from table order by Qty,How to inquire ?
> Thanks!