返回指定日期所屬的季節

 

           set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

create FUNCTION [dbo].[fnQuarterString]
-- returns quarter in form of '3Q2000' to which specified date belongs.
 (
 
@dtmDate datetime
 )
RETURNS char(6-- quater like 3Q2000
AS
BEGIN
   
RETURN ( DateName(q, @dtmDate+ '季度' + DateName(yyyy, @dtmDate))
END 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章