Home > Transact-SQL > Transact-SQL: How to get only date (yyyy-mm-dd) from datetime

Transact-SQL: How to get only date (yyyy-mm-dd) from datetime

17:04

Marek Śliwiński Leave a comment Print This Post  (132) Go to comments
-- How to get shordate from full date format
-- Input: date (datetime) Output: yyyy-mm-dd (varchar)

SELECT
    CONVERT(VARCHAR(10),GETDATE(),120) as Date
Share and Enjoy:
  • DotNetKicks
  • Digg
  • del.icio.us
  • Wikio IT
  • Google Bookmarks
  • Facebook
  • Print
  1. No comments yet.
  1. No trackbacks yet.

Subscribe without commenting