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

  • 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