Home Forums SQL Server 2008 T-SQL (SS2K8) Formatting date of birth using South African ID number RE: Formatting date of birth using South African ID number
cyagasa
SSC Journeyman
Points: 75
More actions
October 9, 2015 at 2:37 am
#1832470
substring is working well
select
,left([IDNumber],2) as year
,SUBSTRING(Idnumber,3,2) as Month
,SUBSTRING (Idnumber,5,2) as day
,SUBSTRING(Idnumber ,7,4) as gender
,substring (idnumber ,10,3) nationality
from table
kind regards
Michael Gasa