title: VB.NET SQL date is changed format in query
body: <p>I've got a date variable that looks like this:</p>
  
  <pre><code>     Dim LogDate As Date = Date.Today.AddDays(-1)
  </code></pre>
  
  <p>the format comes out like: #4/5/2010#</p>
  
  <p>then it goes into a SQL select query as a WHERE clause. When I debug, the query has changed this to '05/04/2010'. I want it to be in the format '04/05/2010' like it is when declared. Any ideas on how I do this?</p>
  
  <p>Hee is the query:</p>
  
  <pre><code> Dim sqlCmd As New SqlCommand("SELECT TOP (100) PERCENT tblBackup.BackupName, 
   tblBackupArchive.BackupDate, tblStatus.Status FROM tblStatus INNER JOIN tblBackupArchive ON 
   tblStatus.StatusID = tblBackupArchive.StatusID INNER JOIN tblBackup ON tblBackupArchive.BackupID      = 
   tblBackup.BackupID INNER JOIN tblClient ON tblBackup.ClientID = tblClient.ClientID WHERE      tblBackupArchive.BackupDate = '" &amp; LogDate &amp; "' AND (tblBackupArchive.StatusID = 3) ORDER BY 
   tblBackupArchive.BackupDate DESC", connection)
  </code></pre>
  
  <p>-- Jonesy</p>