Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create User Object based on DOB

Status
Not open for further replies.

rudraigh

MIS
Jun 10, 2005
17
US
I make use of people's DOB in custom variables to determine their age in a LOT of reports. Can I create a User Object to do this so I don't have to recreate the wheel every time I make a new report? How would I go about doing that?

Thanks,
rud
 
User Objects are normally best left alone. You cannot share them with others, so it is much better to sort this out at universe level...

Ties Blom

 
Unfortunately, that isn't an option in this case.

So, how would I go about creating a UDO to determine age based on DOB?
 
We need more info. This is really a SQL question. What database are you using? How do you want to show the age?

If it's Oracle and you want to show years, then it's just (DOB-sysdate)/365.

You need to be more specific with your question.

Steve Krandel
Symantec
 
Yes, the db is Oracle and I want the age expressed in years.

I don't know how much more specific I can get than "how would I go about creating a UDO to determine age based on DOB?"
1. How does one create a UDO? I don't care if their use is frowned upon. It's what I want to do.
2. How would one make that UDO figure out age given a DOB. I have a formula:
Days between ( {Indvividual\DOB} , Date prompt ( "Enter end date of report" ) ) / 365.25

But when I tried to create a UDO using it I get:

Exception: DBD, ORA-00932: inconsistent datatypes: expected NUMBER got DATE
State: N/A

Any help appreciated.

Thanks,
Rud
 
Oracle use:

Code:
select floor((sysdate - to_date('04/11/1925','DD/MM/YYYY'))/365)

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top