且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从 TSQL 日期时间字段中获取 YYYY-MM-DD 格式的日期?

更新时间:2023-02-06 14:20:14

SELECT CONVERT(char(10), GetDate(),126)

限制您不想要的小时部分的 varchar 排版的大小.

Limiting the size of the varchar chops of the hour portion that you don't want.