×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

derived field for age

derived field for age

derived field for age

(OP)
I need help in creating a sql derived field for people between 12 - 18

RE: derived field for age

What is it that you want the derived field to do - return just those persons who are between 12-18?

Also, what table/column have you used for age?

RE: derived field for age

(OP)
Yes. I need to show persons just between that age group

RE: derived field for age

I'm on Oracal 9 and don't write SQL directly so my reply may not help.  However, it may give you some ideas.

Since you haven't identified which tables/columns you are currently using in your report I'm just going to give you ideas.

If you're looking to create a simple report with only those employees between 12 and 18 the easiest choice is to use the Employees table and the Age column.  Then use Selections and specify: data field Employees.Age is between 12 and 18.  Because you are using the Employees table this will only reflect current employees.

The other choice is to use Personal Data and the Birthdate column (query).  Create a derived field for Age:
Trunc((months_between (sysdate, "PD"."Birthdate"))/12, 0).  Then write the Selection similar to the above version: derived field Age is between 12 and 18.

Sorry if I didn't provide the answer/direction you were looking for.

RE: derived field for age

You need to create a derived field as listed below.

       (TO_CHAR(SYSDATE,'YYYY'))  -
        TO_CHAR("PS_PERSONAL_DATA"."BIRTHDATE",'YYYY')

Then in your selection criteria please select the following for a single age seletion

    derived field YY is equal to number 12

or for mulitple age range use the following selection criteria

    derived field YY is between number 12 and number 15

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close