Get Century from date in SQL server -
how can century year in date field using sql server query?
as, example, period 1901 - 2000 20th century. century, if try left substring of 2 , add 1 year, how can implement year '2000'?
is there function getting century date?
i think want:
select 1 + (year(date) - 1) / 100 century
or alternatively:
select (year(date) + 99) / 100 century
Comments
Post a Comment