Date Conversion
Moderators: chulett, rschirm, roy
Date Conversion
I have to load Date(Flat file as source and datatype as Timestamp (23,3))
ModifiedDate = "04/02/2010 01:00:05 AM" in to
Target table (SQL table as) "2010-04-06 23:50:46.000"
Can anyone please help me with the conversion
Thanks
Hope
ModifiedDate = "04/02/2010 01:00:05 AM" in to
Target table (SQL table as) "2010-04-06 23:50:46.000"
Can anyone please help me with the conversion
Thanks
Hope
Split the date from the time, use the IConv/OConv functions to convert each component and then cat them back together. If you really need the milliseconds then just stick the ".000" on the end.
Both 'conversion' functions are well documented in the Help, give that a shot then let us know what you've tried and what issues (if any) you have with the approach.
Both 'conversion' functions are well documented in the Help, give that a shot then let us know what you've tried and what issues (if any) you have with the approach.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Pretty close.
The 'output' conversion mask is off and needs to be more like what you have on the input side:
Technically, the IConv mask can be simplified but that should work more better for you.
The 'output' conversion mask is off and needs to be more like what you have on the input side:
Code: Select all
OConv(Iconv(DSLink4.ModifiedDate[1,10],"D/DMY[2,2,4]"),"D-YMD[4,2,2]")
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Code: Select all
OConv(Iconv(DSLink4.ModifiedDate[1,10],"D/DMY[2,2,4]"),"D-YMD[4,2,2]")
You are the creator of your destiny - Swami Vivekananda