_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › 譯朱朱7覯讌語襴襦磯濠規蠍
|
|
Describe 譯朱朱7覯讌語襴襦磯濠規蠍 here
CASE
WHEN RIGHT(BirthDT7,1) IN ('9','0') THEN '18' + LEFT(BirthDT7, 6)
ENDWHEN 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) 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
) t
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)
end birthdtwhen 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)
鏤
|
覿螳レ 伎 觜蟆 殊企. (启) |