How to convert Excel date

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

How to convert Excel date

Post by gsym »

Hi All,
I have to populate an oracle table from an Excel sheet.
Converted the Excel sheet to a csv file, using sequential file stage to read it. Date field in the excel sheet in excel format ( like 38895) .
How to convert this to Standard Date Format ( YYYYMMDD) ?
Any help is appreciated..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why not apply a Date format to the speadsheet column so you get a 'real' date in your saved csv rather than Excel's internal date number?
-craig

"You can never have too many knives" -- Logan Nine Fingers
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Post by gsym »

There is one more field with string and excel internal date like 'abc 38895'.
So i thought to do the conversion with the ETL.
I tried with Oconv(iconv(1900-01-01,"D-YMD[4,2,2]")+ 38895,"D-YMD[4,2,2])") ,but its not giving the correct date.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'll need to figure out or look up what Excel uses for its 'zero date'. Shouldn't be too hard.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply