title: Cannot update DateTime field in MSSQL Server
body: <p>I have an update clause in my ASP.NET MVC project and I just want to update single field using current time. I know I could also use GETDATE(), but I need to pass the date parameter from Service layer. So, the query is exactly as shown below and I also tried to use it on MSSQL Server, but encounter the same error: <strong><em>"Incorrect syntax near '.2019'."</em></strong></p>
  
  <blockquote>
    <p>UPDATE com.[Ticket] SET Updated = 29.04.2019 15:25:58 WHERE [Id] = 103</p>
  </blockquote>
  
  <p>Here is the code side where I build the sql clause:</p>
  
  <pre><code>DateTime lastUpdate = DateTime.Now;
  string sql = "UPDATE com.[Ticket] SET Updated = " + lastUpdate + " WHERE [Id] = " + model.Id;
  </code></pre>
  
  <p>Updated field is n datetime type. Do I have to format the date parameter in the update clause? </p>