title: Getting a date from a datetimepicker into mysql
body: <p>I have a datetimepicker in my app which end users will use to choose when an item will be deferred to.</p>
  
  <p>If the user picks a date and hits confirm, the date should be dropped into the mysql record for this entry, but I cant seem to get VB to update the DATE value  :(</p>
  
  <p>I'm thinking its probably a formatting thing, but I'm not sure how to best overcome this.</p>
  
  <p>He're the code behind the 'confirm' button.</p>
  
  <pre><code>  Private Sub ConfirmDefer_Click(sender As Object, e As EventArgs) Handles ConfirmDefer.Click
  
    Dim deferdate As Date = Format(nb_deferdatepicker.Value, "yyyy-MM-dd")
    updatesql("newbusiness_dataset", "action_date", deferdate, "id='" &amp;       nb_prospectid.Text &amp; "'")
  
    nb_defer_schedule.Visible = False
    nb_defer_schedule.Enabled = False
  
    End Sub
  </code></pre>
  
  <p>The 'UpdateSQL' bit is a function I use to simplify updating the db.
  Its output SQL command is as follows: </p>
  
  <pre><code>  UPDATE newbusiness_dataset SET action_date='20/02/2016' WHERE id='100001'
  </code></pre>
  
  <p>Any help appreciated! Thanks in advance</p>