通過年月日得到一個Date

Declare @BeginYear As SmallInt
Declare @EndYear As SmallInt 
Declare @BeginMonth As TinyInt 
Declare @EndMonth As TinyInt

Set @BeginYear = 2009
Set @EndYear = 2010 
Set @BeginMonth = 10
Set @EndMonth = 2
 
Declare @BeginDate As Date 
Declare @EndDate As Date 
Set @BeginDate = DATEADD(MONTH, 12 * @BeginYear - 22801 + @BeginMonth , 1 - 1)
Set @EndDate = DATEADD(MONTH, 12 * @EndYear - 22801 + @EndMonth, 31 - 1)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章