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