declare @date datetime;
set @date = getdate()
select datepart(week,@date) [weekofyear]; --返回int型
select datename(week,@date) [weekofyear]; --返回varchar型
go
时间: 2024-09-20 10:58:12
declare @date datetime;
set @date = getdate()
select datepart(week,@date) [weekofyear]; --返回int型
select datename(week,@date) [weekofyear]; --返回varchar型
go