Page 1 of 1

CONVERT DD-MON-YY to YYYY-MM-DD

Posted: Sun Feb 06, 2011 2:36 am
by praburaj
I have csv source file from that i am getting the date column in the format "dd-mon-yy" but, i need to load into oracle table with the format yyyy-mm-dd. Plz help me how to achieve this.

Posted: Sun Feb 06, 2011 3:41 am
by Ravi.K
Year part is partially avilable. So, whether it could be 20th or 21st Century. So, the below derivation helps for 21st century only. If you have any limitations change accordingly.

DateToString(StringToDate('06-Feb-11','%dd-%mmm-%2000yy'),'%yyyy-%mm-%dd')

Posted: Sun Feb 06, 2011 9:16 am
by chulett
By any chance is your Oracle target column a DATE? If so then you don't need to convert it to any particular format, just convert it to a Date.