Convert Date/Time in SQL


/ Published in: SQL
Save to your folder(s)

These statements convert a date/time field into just a date or a time field


Copy this code and paste it in your HTML
  1. CONVERT(VARCHAR(10), "Enter Date/time field/parameter", "format type")
  2.  
  3. Example: CONVERT(VARCHAR(10), GETDATE(), 101)
  4.  
  5.  
  6. Formats:
  7.  
  8. "101" selects DATE
  9. "108" selects TIME

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.