title: DB2/IDAA: How to properly format VARCHAR to TIMESTAMP with milliseconds
body: <p>I am using IDAA for DB2.  At one point I use TO_DATE to convert some dates and it works:</p>
  
  <p><code>TO_DATE('09/03/2018 06:49:23','MM/DD/YYYY HH:MI:SS')</code></p>
  
  <p>But when I have a VARCHAR value with milliseconds in the timestamp, TO_DATE returns an error.  I looked around online and found an answer that says to use TO_TIMESTAMP but that doesn't work:</p>
  
  <p><code>TO_TIMESTAMP('09/03/2018 06:49:23.443000','MM/DD/YYYY HH:MI:SS.NNNNNN')</code></p>
  
  <p>I've looked at every answer on here and tried many variations.  I've tried every combination of the functions TO_TIMESTAMP, TO_DATE, TIMESTAMP_FORMAT and the format for milliseconds as FF, FF6, NNNNNN.  I get these errors:</p>
  
  <p><code>NO AUTHORIZED FUNCTION NAMED TO_TIMESTAMP HAVING COMPATIBLE ARGUMENTS WAS FOUND. SQLCODE=-440</code></p>
  
  <p><code>SQL error: SQLCODE = -904, SQLSTATE = 57011, SQLERRMC =   Invalid Date.. SQLCODE=-904</code></p>
  
  <p>Maybe it's different for the IDAA? I don't know.</p>
  
  <p>I'm running DB2 for z/OS V11 using IBM Data Studio 4.1.3.  </p>