Hi Anton
 
If you did not use my previous example you may use this:
 
    select * from CustTable where CustTable.createddate ==
            (select maxof(createddate) from Custtable).createddate;


Varden Morris <[EMAIL PROTECTED]> wrote:
Hi Anton,
 
The way you may get around this problem is by using Microsoft SQL statements directly in X++. Try this example in a job.
  
Connection  con = new Connection();
Statement   sqlStmt = Con.createStatement();
ResultSet   SQLcustTrans;
Notes         sqlStr
;
sqlStr =strFmt("select * from custTable where LTRIM(Accountnum) = '%1' AND " + "Name like '%a%'", "100001");
SQLcustTrans = sqlStmt.executeQuery(sqlSTR);
while (SQLcustTrans.next())
{
    print SQLcustTrans.getString(1);
    pause;
}


Varden Morris

 

J. Wray & Nephew Ltd. - Group I.S.

234 Spanish Town Road

Kingston 11, Jamaica, W.I.

 

Phone:  (876) - 923 - 6141 Ext. 2226
Fax:      (876) - 923 - 5372

Cell:      (876) - 3833566
Email:   [EMAIL PROTECTED]

            [EMAIL PROTECTED]  

anton_tjiptadi <[EMAIL PROTECTED]> wrote:

well, not the way I'm expected, but thanks though.... :))

I guess there's a limitation in X++ query....

thanks,


--- In Axapta-Knowledge-Village@yahoogroups.com, "akin"
<[EMAIL PROTECTED]> wrote:
> anton_tjiptadi
>
>     how about this code:
>         custtable   _table1,_table2;
>         date        _date;
>
>         select max(createddate) from _table1;
>         _date = _table.createdate ;
>         select _table2 where _table2.createdate == _date;
>       
>
> ======= 2005-01-25 10:30:06 您在来信中写道:=======
>
> >thanks, but isn't your query will only produce one line / record ?
> >
> >for my case, there might be many record which has the same date.
> >
> >thanks,
> >
> >
> >--- In Axapta-Knowledge-Village@yahoogroups.com, "henrik3.rm"
> ><[EMAIL PROTECTED]> wrote:
> >>
> >>
> >>
> >> Hi,
> >> try this;
> >>
> >> Custtable   Custtable;
> >> ;
> >> select firstonly Custtable order by createdDate desc;
> >>
> >> regards,
> >> Henrik 豷terg錼d
> >> computercamp DK
> >>
> >> --- In Axapta-Knowledge-
[EMAIL PROTECTED], "anton_tjiptadi"
> >> <[EMAIL PROTECTED]> wrote:
> >> >
> >> > Hi,
> >> > How to write a subquery in X++ Select statement
> >> >
> >> > for ex in SQL Server :
> >> > -- select * from CustTable where createddate = (select max
> >> > (createddate) from Custtable)
> >> >
> >> > thanks,
> >
> >
> >
> >
> >
> >------------------------ Yahoo! Groups Sponsor -------------------
-~-->
> >Has someone you know been affected by illness or disease?
> >Network for Good is THE place to support health awareness efforts!
> >http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/kGEolB/TM
> >------------------------------------------------------------------
--~->
> >
> >Sharing the knowledge on Axapta.
> >Yahoo! Groups Links
> >
> >
> >
> >
>
> = = = = = = = = = = = = = = = = = = = =
>                  
>
>         致
> 礼!

>                        
>         akin
> [EMAIL PROTECTED]
>           2005-01-25





Sharing the knowledge on Axapta.


Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.

Sharing the knowledge on Axapta.


Do you Yahoo!?
Yahoo! Search presents - Jib Jab's 'Second Term'

Sharing the knowledge on Axapta.



Yahoo! Groups Links

Reply via email to