Date Conversion
Moderators: chulett, rschirm, roy
Date Conversion
Hi,
I need convert a date format which is year and a day ex:-2007045 to a format 2007-02-14.
can anyone help me regading this?
Thanks !
I need convert a date format which is year and a day ex:-2007045 to a format 2007-02-14.
can anyone help me regading this?
Thanks !
Hi and Welcome to Dsxchange :D !!!!!
Try using
Try using
Code: Select all
StingToDate(Input.field, "%YYYY%DDD")
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Re: Date Conversion
HI ,
Try it using iconv and Oconv function..
ex:if the date is 2007032 which represents 2007-02-01
use the below mentioned function in the transformation stage
OCONV(ICONV('2007032','DYD[4,3]'),'D-YMD[4,2,2]')
Try it using iconv and Oconv function..
ex:if the date is 2007032 which represents 2007-02-01
use the below mentioned function in the transformation stage
OCONV(ICONV('2007032','DYD[4,3]'),'D-YMD[4,2,2]')
Thanks and Regards,
Mohan Ram.T
Mohan Ram.T
The input looks like Julian date to me. Try
ICONV/OCONV is not present in parallel jobs unless you use a basic transformer.
Code: Select all
DateFromJulianDay(in.Date)
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Re: Date Conversion
Hi Mohan,
Iconv/Oconv are BASIC function used in Server jobs, and Basic Transformer in PX jobs which are seldom used.
Iconv/Oconv are BASIC function used in Server jobs, and Basic Transformer in PX jobs which are seldom used.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Do you mind marking the post as resolved.bucks wrote:Thanks kumar and for all the replies,
I have used lengthy procedure for this conversion using function DateFromDaysSince(), using stage var.
Funny thing is, it worked with simple StringToDate(datefield,"%yyyy%ddd").
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'