Posted By

highlyevolved on 11/04/09


Tagged

sql time date DateTime convert


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

highlyevolved
Tyster


Convert Date/Time in SQL


 / Published in: SQL
 

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

  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  

You need to login to post a comment.