Page 1 of 1

StringToDate() issue in transformer stage

Posted: Thu Apr 18, 2013 2:35 am
by HemaV
Hi All,

I used StringtoDate function in transformer stage as below:

StringToDate(Convert('-','',CurrentDate()),"%yyyy%mm%dd")

But in the target date still comes with yyyy-mm-dd format. Unable to understand the issue.

Thanks in Advance,

Posted: Thu Apr 18, 2013 3:31 am
by vamsi.4a6
1)I hope The default date format is yyyy-mm-dd in your project and If you need some other format use DatetoString function but the output will be of type string type.

Posted: Thu Apr 18, 2013 5:57 am
by ray.wurlod
CurrentDate() is not a string, so Convert() will not work on it. Leave it out.

Code: Select all

DateToString(CurrentDate(),"%yyyy%mm%dd") 

Posted: Thu Apr 18, 2013 7:05 am
by HemaV
Thanks All....

DateToString() function works but how can i convert the datatype of string to date as my target column in db is having date datatype :(.

I need to check on project default date format once because StringToDate() function is now working for me...


Thanks,

Posted: Thu Apr 18, 2013 7:17 am
by chulett
HemaV wrote:I need to check on project default date format once because StringToDate() function is now working for me...
:?

"now" = "not"?

There's no need to check on anything as dates don't have a particular format - strings do but dates do not. If you know what format your string date is in, then use that in the StringToDate function and you'll be golden.

Posted: Thu Apr 18, 2013 4:41 pm
by ray.wurlod
Data type Date is stored in a four-byte binary format.