cancel
Showing results for 
Search instead for 
Did you mean: 

to calculate age

former_member214617
Participant
0 Kudos
334

need to create object to calculate age of an employee when he employed using two columns i.e. date of employment and dob, both columns are in different table.

how to do that?

let me know if you need more info

thanks & regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I have one idea ..

Age = Date of employment - DOB

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

1.In Universe _First create the objects with DOE(Date of employeement), DOB(Date of Birth) as a Date object and right click on those objects and set the Object format as Date/Time YYYY. Click on Add for both objects. and Create one more object and select the Object as

Sum(@Select(Employee/DOE)-@Select(Employee/DOB))

2. In Web I_ same like above, 2 objects creation and apply the Fromat in Universe and Web I create a variable with some name as age and in that

=Sum(DOE-DOB)

Click ok.

Hope it will help you...

All the Best,

Madhu....

Former Member
0 Kudos

Hi,

If after adding this sql object will not parse then follow the below steps:

1 Right click on the object at universe level and select object properties.

2. In the definition Tab click on tables button.

3.Hold the ctrl key and select both the tables.

4. Click on apply and ok.

5. Test the object.

Hope it helps.

thanks,

sands

Former Member
0 Kudos

Hello,

Please follow the below steps:

Create a new object at universe level and pass your own sql with the help of below:

SELECT A.EMPNO, Round((A.HIREDATE-B.DOB)/365,2) AS EMPLOYED_DATE

FROM EMP A, EMPDOB B

WHERE A.EMPNO= B.EMPNONO

Above sql will give you the Employed age.

How I have Achieved this:

I have created a new table in the oracle as EMPDOB and taken two column as EMPNONO and DOB.

Inserted the desired records in the table and fired above query and got the correct output.

Hope it helps.

Thanks,

Sands