Posted By

rengber on 09/03/09


database sql simple conversion

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


TSQL Convert DateTime

 / Published in: SQL

I am forever forgetting this. Have to look up the 101 vs 103 in books online every time. Also forget which way around is US/NZ format. :-)

  1. --UK/NZ format dd/mm/yyyy
  2. SELECT CONVERT(DATETIME, '21/03/2000', 103)
  4. --US format mm/dd/yyyy
  5. SELECT CONVERT(DATETIME, '03/21/2000', 101)

Report this snippet  

You need to login to post a comment.