AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.10.2006, 16:40   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
Fred Shen: 'Not Like' in Dynamics AX
Источник: http://fredshen.spaces.live.com/Blog...E4E3!182.entry
==============
In X++, we can use Like '*someIdentifier' to implement the Like keyword.
e.g.
    select firstonly purchTable
        where purchTable.purchId like '00007*';

 
However if you want to use 'Not Like' in X++ SQL statement, you have three options:
The first option, using '!' as 'not',
e.g.

    select firstonly purchTable
         where !(purchTable.purchId like '00007*');

 
The second option, using notExists join
e.g.
    PurchTable purchTable, refPurchTable;
    ;

 
    select firstonly purchTable
        notExists join refPurchTable
        where purchTable.purchId == '00007*';


Please make sure that you do put purchTable.purchId in condition statement, otherwise the SQL statement will retrieve an empty result set.

The last option, using Query
e.g.
    Query query = new Query();
    QueryRun queryRun;
    ; 


    query.addDataSource(tableNum(PurchTable)).addRange(fieldNum(PurchTable, PurchId)).value('!00007*');
    queryRun = new QueryRun(query);

    if(queryRun.next())
    {
        purchTable = queryRun.get(tableNum(PurchTable));
        print purchTable.PurchId;
        pause;
    }

 
Using NotExists join seems more complicated than the first option, but actually there is no performance difference between them.
 



==============
Источник: http://fredshen.spaces.live.com/Blog...E4E3!182.entry
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Inside Dynamics AX 4.0: Usage Scenarios Blog bot DAX Blogs 0 04.10.2007 05:15
Fred Shen: Consuming a Web Service in Dynamics AX 4 Blog bot DAX Blogs 0 28.10.2006 16:40
Fred Shen: RefRecID in Dynamics AX 4 Blog bot DAX Blogs 0 28.10.2006 16:40
Fred Shen: Development Features of Dynamics Ax (Axapta) 4.0 Blog bot DAX Blogs 0 28.10.2006 16:40
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 22:06.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.