Norwegian social security numbers (SSN) is composed like this
substr(ssn,1,6) = ddmmyy
substr(ssn,7,3) =
Person individual numbers:
000–499 persons born 1900–1999.
500–749 persons born 1854–1899.
500–999 persons born 2000–2039.
900–999 persons born 1940–1999.
substr(ssn,11,2)=control digits
I am struggling to convert date of birth to date format DD.MM.YYYY for persons born between 1900 and 1949
select to_date('121049','dd.mm.rrrr') from dual; -- Returns: 12.10.2049
select to_date('121049','dd.mm.rr')from dual; -- Returns: 12.10.2049
select to_date('121049','dd.mm.yy')from dual; -- Returns: 12.10.2049
select to_date('121050','dd.mm.rrrr')from dual; -- Returns: 12.10.1950
select to_date('121050','dd.mm.rr')from dual; -- Returns: 12.10.1950
select to_date('121050','dd.mm.yy')from dual; -- Returns: 12.10.2050
I expecting 121049 to return 12.10.1949. How can I force oracle to return the expected date format given the information I have available to me?
From wikipedia: https://en.wikipedia.org/wiki/National_identification_number#Norway
Historically, the number has been composed of the date of birth (DDMMYY), a three digit individual number, and two check digits. The individual number and the check digits are collectively known as the Personal Number.
The individual number has been selected from a range depending on century of birth: for the years 1854–1899 the range is 500–749, for the years 1900–1999 the range is 000-499, for the years 2000–2039 the range is 500–999. For the years 1940–1999, the range 900–999 was also used for special purposes, such as adoptions from abroad and immigrants. Women have been assigned even individual numbers, men are assigned odd individual numbers.