Page 1 of 1

date conversion funtion

Posted: Wed Aug 18, 2010 1:53 am
by sagar deshmukh
Hi ,

from my souce I am getting date like '2010-04-16-16.08.02.945000'

I want to convert it into the yyyy-mm-dd format

is there any function available to do this?

My source is a csv file.

Posted: Wed Aug 18, 2010 2:03 am
by Sainath.Srinivasan
What is your source ? Is it a sequential file or table ?

If sequential file, you can define it as Varchar and extract as

Code: Select all

yourStringDate[1,10]
For table, search from TimeStampToString function

Posted: Wed Aug 18, 2010 6:14 am
by chulett
Since it is already in that external format, just has a few extra bits, as noted the simplest solution would be to substring.