Timestamp in Teradata

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
dsrules
Premium Member
Premium Member
Posts: 76
Joined: Sun Nov 28, 2004 8:56 pm

Timestamp in Teradata

Post by dsrules »

Hi,
I am using this code for generating the timestamp in DataStage.The Target Table being TeraData. I used this in SQL Server and it worked fine. Even in TeraData it works fine expect the precision is all zero.

Code: Select all

Oconv(DATE(),"D-YMD[4,2,2]"):" ":Oconv(TIME(),"MTS") : ".":field(TIME(),".",2)
The SQl Server Table Value

Code: Select all

2004-12-28 13:54:30.120
In TeraData Table the value is

Code: Select all

2004-12-30 11:28:57.000000
can you tell me where I am wrong.
Thanks
Mack
______________________________________
"Everytime I close the door on reality, it comes in through the windows." - Jennifer Yane
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try

Code: Select all

Fmt(Field(TIME(), ".", 2), "L%6")
insead of

Code: Select all

Field(TIME(), ".", 2)
The Fmt function delivers the six decimal places with trailing zeroes.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply