Page 1 of 1

Date Conversions

Posted: Mon Jan 28, 2008 11:02 pm
by iamnagus
I want to convert the date format dd-mm-yyyy to mm-dd-yy in transformer stage, but it only displaying in yyyy-mm-dd.

(I read the source date format as char from sequential file stage and now i am using StringToDate function to convert into mm-dd-yy. I am getting
yyy-mm-dd only it targer and it also some times viewing as ********** when i tried to view ny dataset management facility).

can any one help for this?

Re: Date Conversions

Posted: Tue Jan 29, 2008 1:06 am
by naveen19
iamnagus wrote:I want to convert the date format dd-mm-yyyy to mm-dd-yy in transformer stage, but it only displaying in yyyy-mm-dd.

(I read the source date format as char from sequential file stage and now i am using StringToDate function to convert into mm-dd-yy. I am getting
yyy-mm-dd only it targer and it also some times viewing as ********** when i tried to view ny dataset management facility).

can any one help for this?
Hi,

U can use this function in the transformer

Field(DSLink3.Date,'-',2) :'-' : Field(DSLink3.Date,'-',1) :'-':Right(DSLink3.Date,4)

. use this function stage variable and then use that in derivation part

Date: column name
source/target metadata: varchar

Regards
Naveen.K

Posted: Tue Jan 29, 2008 1:07 am
by ray.wurlod
What is the format of the data in the character string that you are reading? Use this as the format string in a StringToDate() function. Use that result in a DateToString() function, this time specifying the desired output format. The function calls may be nested.