Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to your comment that filling in only an end date gave you an error, I would suggest you should probably parenthesise your <code>if</code> statement more to force order of operations.</p> <pre><code>if ( (txtComStartDate.Text != (String.Empty) &amp;&amp; DateTime.Parse(itemDate) &gt;= DateTime.ParseExact(txtComStartDate.Text, "dd/MM/yy", provider)) || (txtComEndDate.Text != (String.Empty) &amp;&amp; DateTime.Parse(itemDate) &lt;= DateTime.ParseExact(txtComEndDate.Text, "dd/MM/yy", provider)) || (DateTime.Parse(itemDate) &gt;= DateTime.ParseExact(txtComStartDate.Text, "dd/MM/yy", provider) &amp;&amp; DateTime.Parse(itemDate) &lt;= DateTime.ParseExact(txtComEndDate.Text, "dd/MM/yy", provider)) ) </code></pre> <p>You were probably hanging up on <code>DateTime.ParseExact(txtComStartDate.Text, "dd/MM/yy", provider))</code> which was likely empty, since you were only entering an end date.</p> <p><strong>Edit:</strong> Your problem is the short-circuiting of the conditional. If you enter both a <code>txtComStartDate</code> and a <code>txtComEndDate</code>, your conditional won't make it to the condition (both values entered) since you're using an <code>OR</code>. Since having both a start and an end will make the first part of the statement true, it's going to show all nodes that are past your start date; without regard to your end date.</p> <p>You can do a check for both values before your filter: <code>if(txtComStartDate.Text != (String.Empty))</code>, <code>if(txtComEndDate.Text != (String.Empty))</code></p> <p>and implement the filtering after doing this- ensuring you get the sure intent of the user.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload