Hello All,
I have one object Hdate which is Date and in MM/DD/YYYY format.I need to make three object.I am using Oracle.
Year, Quarter and Month out of this object.
Thanks
SH
SH3230 (BOB member since 2010-10-25)
Hello All,
I have one object Hdate which is Date and in MM/DD/YYYY format.I need to make three object.I am using Oracle.
Year, Quarter and Month out of this object.
Thanks
SH
SH3230 (BOB member since 2010-10-25)
Hello SH,
I am using MySQL and in the select BOX i have used year(table/column) which is returning Year of that object.
I have not worked in Oracle.So, Some one will help you who is using oracle.
Thanks
Pooja
ktm (BOB member since 2008-11-12)
use the following oracle function
to_char(Hdate ,‘yyyy’) -> Year
to_char(Hdate ,‘q’)-> Quarter
to_char(Hdate ,‘mm’) -> Month
sati_sunil (BOB member since 2010-09-16)
But remmember that those functions will create strings. If you need numbers you would have to apply an additional conversion.
Marfi (BOB member since 2006-12-18)
You have several options:
Let’s say the object is Table.date
Month:
Trunc(table.date,'MM')
To_char(table.date,'MM/YYYY')
Quarter:
Trunc(table.date,'Q')
To_char(table.date,'Q/YYYY')
'Q'||To_char(table.date,'Q/YYYY')
so the result will be Q2/2010
Year:
Trunc(table.date,'YYYY')
To_char(table.date,'YYYY')
Dragoran (BOB member since 2009-07-30)