Page 1 of 1

string to date

Posted: Mon Aug 01, 2011 2:56 am
by vishal_rastogi
Hi

i have input field as 09062007 and the output is the date format
i am using the string to date function

StringToDate(DSLink3.col1,"%dd-%mm-%yyyy")

but in the output i am getting "**********"

and similarily for one field i need to convert the same input to timestamp but it is also giving the * values

please suggest..

Re: string to date

Posted: Mon Aug 01, 2011 3:13 am
by kamtammystuff
Hi

Here the second parameter should always represent your input string format.

Posted: Mon Aug 01, 2011 3:21 am
by vishal_rastogi
yes i agree it is in the same format please take a look one more time

Posted: Mon Aug 01, 2011 3:24 am
by kiran0435
use the function as

StringToDate(DSLink3.col1,"%dd%mm%yyyy") .
This will work.

Posted: Mon Aug 01, 2011 3:31 am
by vishal_rastogi
what if i want the output in the format mm/dd/yyyy

Posted: Mon Aug 01, 2011 3:37 am
by kamtammystuff
It depends on the default format defined at you project level.

Posted: Mon Aug 01, 2011 3:39 am
by kiran0435
StringToDate(inputcolumn,[input date format](in your case it is "%dd%mm%yyyy")).

The output for this function will be based on project level parameter which is set in Administrator client for this project.

But you can override with necessary format based on your requirement in job parameters.

go to job parameters--- default tab--- then change format defaults according to your requirement.

Posted: Mon Aug 01, 2011 3:57 am
by vishal_rastogi
thanks kiran its working fine for me now

Posted: Mon Aug 01, 2011 6:27 am
by chulett
Hmmm... DATE datatypes don't have formats, people. :?