How to <%# Eval() %> and alter a date
<p>I am trying to add a link with parameters only if certain things are retrieved from the database.</p>

<p>Here is my code:</p>

<pre><code>protected void GetOrderLines (string OrderID)
{
    string query;
    query = "SELECT ol.ItemId, ol.Amount, ol.Quantity, i.description, ol.RetailPrice, o.OrderDate";
    query += " FROM Distributor d";
    query += " INNER JOIN Orders o";
    query += " ON o.DistID = d.DistID";
    query += " INNER JOIN Orderlines ol";
    query += " ON ol.OrderID = o.OrderID";
    query += " INNER JOIN Items i";
    query += " ON i.InventoryID = ol.ItemID";
    query += " WHERE ol.OrderID = " + OrderID;
    query += " AND ol.GroupItem = 0";
    query += " AND d.DistID = " + Session[ "Distid" ];

    DataTable data = GeneralFunctions.GetData( query );

    RepeaterOrderlineInfo.DataSource = data;
    RepeaterOrderlineInfo.DataBind();
}
</code></pre>

<p>Here is the data it gives me:</p>

<pre><code>ItemId  Amount  Quantity    description RetailPrice OrderDate
6015    660 1   Item 1  660 5/1/2012
6021    199.2   332 Item 2  0.6 5/1/2012
6018    150 6   Item 3  25  5/1/2012
9000    85  4   Technical Support   21.25   5/1/2012
8000    125 4   Custom Programming and Misc. Fees   31.25   5/1/2012
</code></pre>

<p>Here is the Eval code on the page:</p>

<pre><code>&lt;asp:Repeater ID="RepeaterOrderlineInfo" runat="server"&gt;
    &lt;ItemTemplate&gt;
        &lt;tr&gt;
            &lt;td&gt;
                &lt;%# Eval("Itemid") %&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;%# Eval("description") %&gt;
            &lt;/td&gt;
            &lt;td align="right"&gt;
                &lt;%# Eval("RetailPrice", "{0:C}") %&gt;
            &lt;/td&gt;
            &lt;td align="right"&gt;
                &lt;%# Eval("Quantity") %&gt;
            &lt;/td&gt;
            &lt;td align="right"&gt;
                &lt;%# Eval( "Amount", "{0:C}" )%&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/ItemTemplate&gt;
&lt;/asp:Repeater&gt;
</code></pre>

<p>I am trying to build a link for the <code>&lt;%# Eval("Description") %&gt;</code></p>

<pre><code>&lt;a href="SupportSummary.aspx?sd="&lt;%# Eval("OrderDate") %&gt;&amp;ed=&lt;%# Eval("OrderDate") //- 1 month %&gt;"&gt;&lt;%# Eval("Description") %&gt;
</code></pre>

<p>I only need the description to be a link if the <code>description = "Technical Support"</code>.  Is this possible when using a repeater?</p>

<p>So the main things I am seeking here are:</p>

<p>How to Eval the OrderDaye and subtract one month.
How to do a condition on the description only if it = "Technical Support".</p>
