How to convert string value to timestamp
ex: string value(yyyymmdd) 20080709
Thanks
string to timestamp
Moderators: chulett, rschirm, roy
Re: string to timestamp
if you are inserting the value in database with column of sql type as timestamp then you need a format as 'YYYY-MM-DD HH24:MI:SS', do concatenation to get this format with proper time you want.
inputstring[1,4]:'-': inputstring[5,2]:'-':inputstring[7,2]:' ':'00:00:00'
inputstring[1,4]:'-': inputstring[5,2]:'-':inputstring[7,2]:' ':'00:00:00'
Re: string to timestamp
I am getting warning messages
test..Sort: At row 1, link "DSLinkxx", while processing column "DT"
Value treated as NULL
Attempt to convert String value "20080709" to Timestamp type unsuccessful
Input souce column datatype is varchar
test..Sort: At row 1, link "DSLinkxx", while processing column "DT"
Value treated as NULL
Attempt to convert String value "20080709" to Timestamp type unsuccessful
Input souce column datatype is varchar
sachin1 wrote:if you are inserting the value in database with column of sql type as timestamp then you need a format as 'YYYY-MM-DD HH24:MI:SS', do concatenation to get this format with proper time you want.
inputstring[1,4]:'-': inputstring[5,2]:'-':inputstring[7,2]:' ':'00:00:00'
satya
Re: string to timestamp
your formatting is wrong i think please can you check my previous post
Re: string to timestamp
every thing looks good, i created a test column to check the output leaving the original one, the warning is regarding the original column.
Thanks sachin
Thanks sachin
sachin1 wrote:your formatting is wrong i think please can you check my previous post
satya