sqlServer日期转换成字符串

convert(char(7), begindate, 120) = '2020-07'

convert是一个函数,

char(7)表示我只要7个字符串,

begindate是一个日期字段,

返回的类型大致和'2020-07'类似的一个年月

posted @ 2020-09-15 20:33  草木深  阅读(3528)  评论(0编辑  收藏  举报