_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › 譯朱朱7覯讌語襴襦磯濠規蠍
Describe 譯朱朱7覯讌語襴襦磯濠規蠍 here


CASE
WHEN RIGHT(BirthDT7,1) IN ('9','0') THEN '18' + LEFT(BirthDT7, 6)
WHEN RIGHT(BirthDT7,1) IN ('1','2') THEN '19' + LEFT(BirthDT7, 6)
WHEN RIGHT(BirthDT7,1) IN ('3','4') THEN '20' + LEFT(BirthDT7, 6)
WHEN RIGHT(BirthDT7,1) IN ('5','6') THEN '19' + LEFT(BirthDT7, 6)
WHEN RIGHT(BirthDT7,1) IN ('7','8') THEN '20' + LEFT(BirthDT7, 6)
END



declare @birth7 char(7)
set @birth7 = '7611181'

select
datediff(yy, left(birthdt,8), getdate()-1)
+ case when right(birthdt, 4) > right(convert(char(8), getdate()-1, 112), 4) then -1 else 0 end age
, gender
from (
select
case when right(@birth7,1) % 2 = 1 then '' else '' end gender
, case
when right(@birth7,1) in (3,4,7,8) then '20' + left(@birth7,6)
when right(@birth7,1) in (1,2,5,6) then '19' + left(@birth7,6)
when right(@birth7,1) in (9,0) then '18' + left(@birth7,6)
end birthdt
) t
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:52

蟲郁 蟆 豌朱 螻旧 譟 蠏瑚 覦讌 襷螻 蟇一企. 覈 覲糾骸 螻旧 蠏碁訖 覦豌 れ 讌螳.