Page 1 of 1

string to date function

Posted: Sat Nov 01, 2008 3:33 am
by prasanna_anbu
Hi
I have used in a stage variable like

If(LKP_To_TFM_Check_Null.transaction_dt = "") Then 13 else If(Len(LKP_To_TFM_Check_Null.transaction_dt)<11) Then 13 Else If(IsValid("date",StringToDate(LKP_To_TFM_Check_Null.transaction_dt[1,11],"%mmm %dd %yyyy"))) Then 0 Else 13


in this i have get NOV 3 2008 instead NOV 03 2008

or i have get ****** what can i do for this

Posted: Sat Nov 01, 2008 7:44 am
by ArndW
What is your value of LKP_To_TFM_Check_Null.transaction_dt ?

Posted: Sat Nov 01, 2008 9:18 am
by prasanna_anbu
the value for LKP_To_TFM_Check_Null.transaction_dt is

Oct 29 2008 12:00:00:000AM

Nov 3 2008 12:00:00:000AM

Posted: Sat Nov 01, 2008 1:35 pm
by ray.wurlod
Your first problem is the one- or two-digit day numbers in conjunction with a substring that takes the first eleven characters of the string. Get this right first, by substringing into separate components (in stage variables) then manipulating the day number before re-assembly. You need to add the leading zero to the day number if it is a single digit. For example

Code: Select all

Right("00" : svDayNumber, 2)