title: decode the day and compare with a column
body: <p>I have columns:</p>
  
  <p>1.:<code>delivery_date</code> column.. It returns the day of the week, like this:</p>
  
  <pre><code>1  --monday
  2  --tuesday
  3  --wednesday
  4  --thursday
  5  --friday
  </code></pre>
  
  <p>2.: <code>date</code> column.. It returns the date of the pick up - it's a normal date column - example: <code>25.03.2019 (format DD.MM.YYYY)</code></p>
  
  <p><strong>But,</strong> our system automatically compare &amp; sets the <code>date</code> to the nearest  <code>delivery_date</code>.</p>
  
  <p>Example: </p>
  
  <p>the partner has <code>delivery_date</code> <strong>every week</strong> on thursday and on tuesday.. [so 4 and 2]. He wants to pick up the goods on friday. At this time our system changes the <code>date</code> to thursday. But i want the next <code>date</code>, which is tuesday - <strong>and i want to decode it to date (format DD.MM.YYYY)</strong></p>
  
  <p>So output be like:</p>
  
  <pre><code>--if pick up date: 22.03.2019 (friday)
  --partner has delivery_date: 4,2(thursday, tuesday)
  
  I want to get: 26.03.2019 --as output
  </code></pre>
  
  <p>I can compare the columns.. that's not problem.. But how can i decode the "actual pick up" date ?</p>
  
  <p>How can i do that ?</p>