Page 1 of 1

Date type conversion

Posted: Thu Oct 09, 2008 1:41 pm
by senthilmp
Hi ,

I have a source file containing the date as

eg:

20080120(YYYYMMDD) and i want this to be tranformed into output target table in date format, pls help me out to do so.

Thanks,
Senthil

Posted: Thu Oct 09, 2008 1:43 pm
by mandyli
Hi

What is your target database?

Posted: Thu Oct 09, 2008 1:54 pm
by chulett
What "date format" do you need? There's always an IConv/OConv pair but if your incoming format is consistent then substring should be fine. For example:

Code: Select all

YourField[1,4]:"-":YourField[5,2]:"-":YourField[7,2]
To change YYYYMMDD to YYYY-MM-DD.

Posted: Sat Oct 11, 2008 10:37 am
by senthilmp
mandyli wrote:Hi

What is your target database?

My target database is Oracle

Posted: Sat Oct 11, 2008 10:44 am
by senthilmp
chulett wrote:What "date format" do you need? There's always an IConv/OConv pair but if your incoming format is consistent then substring should be fine. For example:

Code: Select all

YourField[1,4]:"-&quo ...[/quote]

I need DD-MON-YYYY format ie (I am creating table through Datastage itself, using create table option)

Posted: Sat Oct 11, 2008 12:53 pm
by chulett
For Oracle you don't "need" any particular format, so long as the TO_DATE() mask matches your data.