1 ALTER FUNCTION [dbo].[英文星期] 2 ( 3 @ADay DATETIME 4 ) RETURNS VARCHAR(20) 5 BEGIN 6 DECLARE @Week VARCHAR(20) 7 SELECT @Week = CASE DATEDIFF(dd, DATEADD(wk, DATEDIFF(wk,0, @ADay), 0), @ADay) + 1 8 WHEN 0 THEN 'Sunday' 9 WHEN 1 THEN 'Monday' 10 WHEN 2 THEN 'Tuesday' 11 WHEN 3 THEN 'Wednesday' 12 WHEN 4 THEN 'Thursday' 13 WHEN 5 THEN 'Friday' 14 WHEN 6 THEN 'Saturday' 15 END 16 RETURN @Week 17 END
标签:星期,ADay,VARCHAR,DATEDIFF,WHEN,英文,END,Week From: https://www.cnblogs.com/ljtao/p/17630552.html