<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="https://www.schweda.net/style_feed.css" ?>
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:atom="http://www.w3.org/2005/Atom"	
	xmlns:dc="http://purl.org/dc/elements/1.1/" > 
<channel>
    <title>schweda.net - Blog</title>
    <link>https://www.schweda.net/</link>
    <description>schweda.net - Blog - Blog-Beitraege</description>
    <language>de-at</language>
    <copyright>Copyright 2006-2026</copyright>
    <generator>schweda.net</generator>
    <managingEditor>heinz.schweda@schweda.net (Heinz Schweda)</managingEditor>
    <webMaster>heinz.schweda@schweda.net (Heinz Schweda)</webMaster>
    <category>Blog</category>
	<atom:link href="https://www.schweda.net/blog_rss.php?bid=498" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA[Makro innerhalb eines SELECT-Statements verwenden]]></title>
<description><![CDATA[
<p>Das Beispiel listet beispielsweise nur aktive St&uuml;cklistenpositionen (Tabelle <em>BOM</em>) auf (aktiv &uuml;ber die Felder <em>FromDate </em>und <em>ToDate</em>). L&auml;sst man den zweiten Parameter des Makros leer (dateNull()), so werden alle St&uuml;cklistenpositionen gelistet.
</p>


<pre class="pre_blog_axcode">
static void useMacroInSelectStatement(Args _args)
{
    bom bom;
    date emptyDate;
    
    // parameters: %1 = table instance, %2 date, %3 empty date value
    #localmacro.bomDateFilter
        &amp;&amp; ( %2 == dateNull() || (
            ((%1.FromDate &lt;= %2) &amp;&amp; (%1.ToDate &gt;= %2)) ||
            ((%1.FromDate == %3) &amp;&amp; (%1.ToDate == %3)) ||
            ((%1.FromDate &lt;= %2) &amp;&amp; (%1.ToDate == %3)) ||
            ((%1.FromDate == %3) &amp;&amp; (%1.ToDate &gt;= %2))
            ))
    #endMacro
    ;
    
    while select bom
    where bom.ItemId == &#39;123&#39;
    #bomDateFilter(bom, systemDateGet(), emptyDate)
    {
        info(bom.bomid);
    }
}
</pre>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 25 Jan 2014 12:21:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=498</link>
<comments>https://www.schweda.net/blog_ax.php?bid=498</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=498</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=498</wfw:commentRss>
</item>
<item>
<title>Kommentar von anonymous</title>
<description><![CDATA[Servus Heinz, das geht auch ohne macro, mit (!fromDate || bom.fromDate == fromDate)
lg]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sun, 26 Jan 2014 09:13:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=498</link>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=498</guid>
<author>anonymous</author>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Heinz Schweda</dc:creator>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=498</wfw:commentRss>
</item>
<item>
<title>Kommentar von Heinz Schweda</title>
<description><![CDATA[@ anonymous
Mir ging es in meinem Beitrag prinzipiell darum, daß man und wie man Makros als Teil eines SELECT-Statements verwenden kann. Wenn jemand mein Code-Beispiel 1:1 verwenden kann, dann wäre das schön, aber wohl reiner Zufall.
Nichts desto trotz vermisse ich in dem Code-Fragment von Dir etwas, derzeit würde es doch nur Datensätze liefern wo entweder kein FromDate oder ein ganz bestimmtes Fromdate eingetragen ist, oder?]]></description>
<category></category>
<pubDate>Fri, 14 Feb 2014 17:37:00 +0100</pubDate>
<link>https://www.schweda.net/blog.php?bid=498</link>
<guid isPermaLink="true">https://www.schweda.net/blog.php?bid=498</guid>
<author>Heinz Schweda</author>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Heinz Schweda</dc:creator>
<wfw:commentRss>https://www.schweda.net/blog.php?bid=498</wfw:commentRss>
</item>
</channel>
</rss>	
