Page 1 of 1

StringtoTimestamp + Substring

Posted: Fri Apr 06, 2007 10:07 am
by DS_MJ
Hello All:

I have in my job properties - Parameters the following:

EXTRACTSTARTDT String 19000101000000000
EXTRACTENDDT String 20060906123746890

Target Table (MSSQL)
Target_column_Name Timestamp 23,3 (Len,Scale)

I am trying the to load the Parameters into the target table by using substring along with stringtotimestamp. However the end part is totally lost cause I am trying to mix server into Px job. Please help to rectify:

Thanks in advance.

Code: Select all

Stringtotimestamp(Substrings(EXTRACTENDDT[1,4]):'-':Substrings(EXTRACTSTARTDT[5,2]):'-':Substrings(EXTRACTSTARTDT[7,2],"D-YMD[4,2,2]"):"00:00:00","%yyyy-%mm-%dd %hh:%nn:%ss") 

Posted: Fri Apr 06, 2007 10:23 am
by ray.wurlod
Just lose the Substrings() functions - the square bracket notation is sufficient to represent substringing. Also lose the Oconv() specification!

Code: Select all

StringToTimestamp(EXTRACTENDDT[1,4]:'-':EXTRACTSTARTDT[5,2]:'-':EXTRACTSTARTDT[7,2]:" 00:00:00.000","%yyyy-%mm-%dd %hh:%nn:%ss.3") 

Posted: Fri Apr 06, 2007 12:19 pm
by DS_MJ
ray.wurlod wrote:Just lose the Substrings() functions - the square bracket notation is sufficient to represent substringing. Also lose the Oconv() specification!

Code: Select all

StringToTimestamp(EXTRACTENDDT[1,4] ...[/quote]

Thanks Ray.