<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Doens.be &#187; JOIN</title>
	<atom:link href="http://www.doens.be/tag/join/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doens.be</link>
	<description></description>
	<lastBuildDate>Sat, 07 Jan 2012 04:20:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using &#8216;Not Like&#8217; in Ax X++</title>
		<link>http://www.doens.be/2009/10/using-not-like-in-ax-x/</link>
		<comments>http://www.doens.be/2009/10/using-not-like-in-ax-x/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 17:22:42 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[JOIN]]></category>
		<category><![CDATA[LIKE]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=266</guid>
		<description><![CDATA[When you want to use wild-cards in Ax, you can write a SQL statement with a LIKE keyword 1 2 select firstonly purchTable where purchTable.purchId like '09*'; When you want to have all the other records (not like), in X++ SQL-statements you have 3 possibilities: 1.!LIKE : 1 2 select firstonly purchTable where !&#40;purchTable.purchId like [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to use wild-cards in Ax, you can write a SQL statement with a LIKE keyword</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">select</span> <span style="color: #0000ff;">firstonly</span> purchTable
<span style="color: #0000ff;">where</span> purchTable.<span style="color: #000000;">purchId</span> <span style="color: #0000ff;">like</span> <span style="color: #ff0000;">'09*'</span>;</pre></td></tr></table></div>

<p>When you want to have all the other records (not like), in X++ SQL-statements you have 3 possibilities:<br />
1.!LIKE :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">select</span> <span style="color: #0000ff;">firstonly</span> purchTable
<span style="color: #0000ff;">where</span> <span style="color: #00007f;">!</span><span style="color: #000000;">&#40;</span>purchTable.<span style="color: #000000;">purchId</span> <span style="color: #0000ff;">like</span> <span style="color: #ff0000;">'09*'</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>2. notExists join :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">select</span> <span style="color: #0000ff;">firstonly</span> purchTable
    <span style="color: #0000ff;">notExists</span> <span style="color: #0000ff;">join</span> refPurchTable
    <span style="color: #0000ff;">where</span> purchTable.<span style="color: #000000;">purchId</span> <span style="color: #00007f;">==</span> <span style="color: #ff0000;">'09*'</span>;</pre></td></tr></table></div>

<p>3. Query-object :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;">Query query <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> Query<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
QueryRun queryRun;
; 
query.<span style="color: #000000;">addDataSource</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">tableNum</span><span style="color: #000000;">&#40;</span>PurchTable<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">addRange</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">fieldNum</span><span style="color: #000000;">&#40;</span>PurchTable<span style="color: #00007f;">,</span> PurchId<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">value</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'!09*'</span><span style="color: #000000;">&#41;</span>;
queryRun <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> QueryRun<span style="color: #000000;">&#40;</span>query<span style="color: #000000;">&#41;</span>;
<span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span>queryRun.<span style="color: #0000ff;">next</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    purchTable <span style="color: #00007f;">=</span> queryRun.<span style="color: #000000;">get</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">tableNum</span><span style="color: #000000;">&#40;</span>PurchTable<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">print</span> purchTable.<span style="color: #000000;">PurchId</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0000ff;">pause</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2009/10/using-not-like-in-ax-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

