Date conversions

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Jay
Participant
Posts: 105
Joined: Tue Nov 11, 2003 8:28 pm

Date conversions

Post by Jay »

Hi All,

How do i convert a date in Oracle 9i Timestamp format to an Oracle 9i date in YYYYDDD format ?

Without iconv/oconv i am running out of ideas....i tried the TimestampToDate...but i have not been successful so far...

Thanks in advance
Jay
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How about converting it with a TO_CHAR function in the original SQL that extracts it from the table?
:idea:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Jay
Participant
Posts: 105
Joined: Tue Nov 11, 2003 8:28 pm

Post by Jay »

That is what i did....

i have the input string in YYYYDDD format and

target is a date in YYYYDDD format....

how do i do the reverse...something like a to_date()....will it work if i do a to_date() in the insert/ update statements....

problem is i cannot test it...i am getting that darn "Oracle does not exist" error...

i was thinking maybe because of the mismatch in metadata, i might be getting the error or it actually is a config/path error.....
Jay
Participant
Posts: 105
Joined: Tue Nov 11, 2003 8:28 pm

Post by Jay »

Anyways, thanks for your time, Ray...
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

Why not StringToDate(TimeStampToString())? You will need a Left() or something within there somewhere to truncate the output from TimeStampToString().
Post Reply