Page 1 of 1

Conversion from String to Date

Posted: Mon Jan 02, 2006 6:52 am
by bala_135
Hi,

I have a column with Datatype varchar length 19.It's a date column.I wanted varchar type to be changed to date.

I am trying the following.

source field->5/1/2003 0:00:00 datatype- varchar length- 19
Transform function->StringToDate(DSLink8.First_Due_Date).
Result---->**********

Any suggestions.

Regards,
Bala.

Posted: Mon Jan 02, 2006 7:10 am
by ArndW
Bala,

the date functions in PX are very particular when it comes to formatting; and the default of %dd/%mm/%yyyy %hh:%nn:%ss doesn't match your string - thus the output is undefined. You will need to change your input string to have a fixed length format before you can use the StringToDate() function.

Re: Conversion from String to Date

Posted: Mon Jan 02, 2006 8:00 am
by ganive
Hi,

You have to enter the StringToDate Function which format your source string is.

In your Case, use :
StringToDate(DSLink8.First_Due_Date,"%dd%mm%yyyy %hh%nn%ss")
Maybe you'll have to manipulate your source field so that it can fit the format.

Also, beware of NULLABLE field while applying such function (of your source field is nullable, you have to handle it).

++
bala_135 wrote:Hi,

I have a column with Datatype varchar length 19.It's a date column.I wanted varchar type to be changed to date.

I am trying the following.

source field->5/1/2003 0:00:00 datatype- varchar length- 19
Transform function->StringToDate(DSLink8.First_Due_Date).
Result---->**********

Any suggestions.

Regards,
Bala.