Select sum in X++

I am new to Axapta. I don’t not sure how to do a simple SQL select sum in X++, could any one help?

SELECT firstonly SUM(CLOSINGQTY)
FROM Table
WHERE Table.TransDate == _TransDate

&& (Table.ItemId == _itemId) ;

I want to return the ClosingQty using a function. Any resource I could refer to ?

Many Thanks!

Table table;
;
select sum(amountMST) from table where table.AccountNum == “1”;

Hi,

first try to go through the basic documentation given by Microsoft for x++ development…

which will help you in understanding the things…

“All the best”…

Dear Kranthi, I refer to your post regularly.

I need a little help. Is it poosible to put select sum statement in a variable? like

a = select sum(field) where field = variable;

Pelase reply.

Hey,

select sum(CLOSINGQTY) where Table.Field = variable
a = Table.ClosingQty [total will be stored in the variable ‘a’]

Hi Naresh,

Thanks a ton.