GetDate() Format
-- ## current date with time is yyyy-mm-dd hh:mm:ss
SELECT GETDATE()
-- ## current date without time is yyyymmdd
SELECT CONVERT(CHAR(8), GETDATE(), 112)
-- ## current date without time is yyyy-MM-dd
SELECT CONVERT(CHAR(10), GETDATE(), 126)
SELECT GETDATE()
-- ## current date without time is yyyymmdd
SELECT CONVERT(CHAR(8), GETDATE(), 112)
-- ## current date without time is yyyy-MM-dd
SELECT CONVERT(CHAR(10), GETDATE(), 126)
Comments
Post a Comment