This discussion is archived
8 Replies Latest reply: Apr 14, 2013 12:26 PM by 1002942 RSS

converting part of the string to a date and subtract with sysdate.

1002942 Newbie
Currently Being Moderated
HINT! In order solve this you must know how the pnr is assembled. Study this:

650323-5510, we only need the first six characters. They inform us about when the person (car owner) was born. In this case it is 23 Mars 1965. You have to use several oracle built-in-functions to solve this. Hint! Begin by converting part of the string to a date and subtract with sysdate.


select to_char(to_date(cast(pnr,'YYMMDDMM'))) from car_owner;


please what am i doing wrong. i need the result to be something like this

Hans, Rosenboll, 59,6 years.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points