Jason Bennett's Developer Corner

 






Click to see the XML version of this web page.

>


View David Jason Bennett's profile on LinkedIn

 

 

A Little About Jason Bennett ...

I've had an interest in publishing technical articles and HELPFUL code for a few years.  I am (by trade and hobby) a developer who specializes in Oracle technologies and web based architectures.  I have been an employee of both TUSC and Oracle Corporation.  My intent here is to share my ideas and coding experiences with the developer community as a whole.  As with all developers some of my ideas are great and some of them are ....  well you know.  Anyway, I hope you find something here that will aid in your endeavor, or spark a new idea. 

I am more than happy to assist with technical issues and will even write a little code if need be. If you find something on the site that is really useful and you'd like to make a contribution (absolutely up to you and absolutely not required), just click the "Make a Donation" button on the left!

Good luck and good coding !




  Wednesday, January 25, 2006


PL/SQL Age Calculation Function

Ok ... a lot of people may already know this method for determining a person's age, but it is useful.  In fact, I used it today.  If you work in a business where you are frequently asked to generate reports or find data with an age range as a search criteria, or as an end result, then you need this little bit of code/SQL in your bag of tricks.

CREATE OR REPLACE FUNCTION getAge(p_dob DATE, p_base_date DATE := SYSDATE) RETURN NUMBER

IS

      v_age NUMBER(3) := 0;

BEGIN

     v_age := TRUNC(MONTHS_BETWEEN(p_base_date,p_dob)/12);

     RETURN v_age;

END;


10:39:45 PM    

Click here to visit the Radio UserLand website. © Copyright 2008Jason Bennett.
Last update: 8/28/2008; 9:47:35 PM.

January 2006
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Nov   Jul