title: MySQL query results with weekday between 2 dates
body: <p>I need a query to get results from a table that has 2 columns</p>
  
  <p>Column startdt (datetime), Column enddt (datetime)
  there are some records with startdt 2013-07-19 and enddt 2013-07-29</p>
  
  <p>I need to get the records with weekday = 1 (Tuesday)<br>
  the record with date 2013-07-19 is weekday 4 and ends 2013-07-29 which is 0 </p>
  
  <p>Actually i want to get the results that has for weekday Monday or another weekday.</p>
  
  <p>You can check the above link for an example
  <a href="http://sqlfiddle.com/#!2/a80ce/1" rel="nofollow">http://sqlfiddle.com/#!2/a80ce/1</a></p>
  
  <p>If you don't understand what i want to do let me explain. I have an event that starts July 15 and ends July 25. (Starts Monday and ends Thursday) The user selects one of the week days (Monday, Tuesday etc). If he select Tuesday then i want the query that will get all events that are active in Tuesday.</p>
  
  <p>I already found the answer so if anyone want to check it</p>
  
  <pre><code>SELECT articleid,startdt,enddt,dayofweek(startdt), DATEDIFF(enddt,startdt) datedf 
  FROM events 
  WHERE (dayofweek(events.startdt) &lt;= 3 AND dayofweek(events.enddt) &gt;= 3)
  OR DATEDIFF(enddt,startdt) &gt;=6
  </code></pre>
  
  <p>(3 is the number of the weekday "Tuesday")</p>