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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 13.09.2012, 21:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,497 / 847 (79) +++++++
Регистрация: 28.10.2006
ax-erp: ‘Not Like’ in Dynamics AX
Источник: http://microsoft-dynamics-ax-erp.blo...namics-ax.html
==============


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://microsoft-dynamics-ax-erp.blo...namics-ax.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
За это сообщение автора поблагодарили: alex55 (1).
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Sample Design Patterns: Book Give-away: 'Microsoft Dynamics AX 2012 Development Cookbook' Blog bot DAX Blogs 1 12.05.2012 16:55
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 7 Blog bot Dynamics CRM: Blogs 0 27.03.2012 02:11
dynamics-ax: Microsoft Highlights New ERP Public Sector Capabilities for AX 2012 Blog bot DAX Blogs 0 23.05.2011 19:11
dynamics-ax: Interview with Amber Kirkman, Director of Marketing - Sunrise Technologies Blog bot DAX Blogs 0 30.09.2010 23:06
emeadaxsupport: List of fixes that improve performance of certain features in Dynamics AX 2009 Blog bot DAX Blogs 0 13.10.2009 19:06

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

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

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