hi Ryan

find this as ur solution

static void Job1(Args _args)
{
str sql;
accountNum acno1;
salesId s;
int i;
str k;
real r2;
Connection Con = new Connection();
Statement Stmt = Con.createStatement();

Statement Stmt2 = Con.createStatement();

ResultSet R,R1;
   sql = " SELECT
Sum(SalesLine.RemainSalesPhysical*SalesLine.SalesPrice),SalesLine.salesID
FROM SalesLine GROUP BY SalesLine.salesID";

    R=Stmt.executeQuery(sql);
    while (R.next())
   {
         r2 = r.getReal(1);
         s = r.getString(2);
         Print acno1;
         print num2str(r2,14,2,0,0) + " " + s;

    }
    pause;

}

regards

Nitesh




----- Original Message -----
From: "rzillmer" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, March 11, 2005 9:16 PM
Subject: [development-axapta] using group by and calculated fields


>
>
>
> Hello, I am new to Axapta so please forgive me if this is an easy
> question.
>
> I am trying to make a calculated field and a group by in the same
> query.  This is the query I'm trying to reproduce in Axapta:
>
> SELECT Sum(SalesLine.RemainSalesPhysical*SalesLine.SalesPrice),
> SalesLine.salesID FROM SalesLine GROUP BY SalesLine.salesID;
>
> If you don't understand that, I'm trying to retrieve the total
> amount for all the physical remaining on each sales order.  I am
> open to an easier way to do this if anyone knows of one.
>
> I am trying to use as little code as possible in my reports but am
> willing to use code if that is the only way to accomplish this.
>
> Thanks in advance for any help!
> Ryan
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>





Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to