cancel
Showing results for 
Search instead for 
Did you mean: 

Extract Month from DateTime

Former Member
0 Kudos

Hi.

I am unable to extract Month from DateTime. I'm using oracle as DB.

I have tried to_char(to_date(DWD_PRODUCT_EOP.BUSINESS_DATE,'MM-dd-yyyy'),'MM') it is showing ORA-00911 invalid character error.
Can anyone help me please.

My actual date format is like: dd/MM/yyyy hh:mm:ss AM
I want to extract month from it.

Thanks in Advance,

Santhosh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In UDT, use this:

EXTRACT(MONTH FROM DWD_PRODUCT_EOP.BUSINESS_DATE)

Former Member
0 Kudos

Thank you Mark. I have used this before but now i have changed the type of variable to number. I missed this before.

Former Member
0 Kudos

Another way: to_char(DWD_PRODUCT_EOP.BUSINESS_DATE,'MM') 

Answers (2)

Answers (2)

Former Member
0 Kudos

Right clicking on a date column in the data foundation should give you the option to extract the month automatically, can you try that?

Former Member
0 Kudos

Hi Victor,

Data foundation is in IDT I think, I am expecting for Universe Design Tool. version 4.0 sp4.

Former Member
0 Kudos

FormatDate(datefield(); "Mmm" )


This will extract month from the string.



Hope this helps!


Thanks,

Imran

Former Member
0 Kudos

Hi Imran,

Those all are for webi, but i want in Universe Design tool.