How To Create Generic Time Class, Which Includes Objects Year, month And Qtr? Database In Use Is Oracle?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this answer should be reported.
Ch Kashif
If your database consist all dates something like 01/02/2000 or 01-Feb-2000, you will need to break the date field into year, qtr, month & if required date.
to do this, create a class named TIME, under that create new object, in it’s select box use oracle’s date functions to get required information.
For E.g. : to_char(sales_date, ‘YYYY’) for getting only year from the date.
similarly, for quarter you can use to_char(sales_date, ‘Q’) & for month to_char(sales_date, ‘MM’) for month number, instead of ‘MM’ if you
use ‘MON’ it will return you abbreviations like Jan for January & so on. for full name of month use ‘MONTH’.