34,593
社区成员
发帖
与我相关
我的任务
分享
select datepart(month,getdate())
/*
2
*/
select cast(month('2008-02-20') as char(1))
select *
from tb
where 月份=cast(month(getdate()) as char(2))
select convert(char(2),month('2008-02-20'))
select convert(int,month('2008-02-20'))
select cast(month('2008-02-20') as char(2)) 月份
select convert(int,day(getdate()))
select '当前月份为:第'+cast(datepart(m,getdate()) as varchar)+'月'
---------------------------------------------
当前月份为:第2月
(所影响的行数为 1 行)
select *
from tb
where tbmonth=substring(convert(varchar(20),getdate(),120),6,2)