Page 1 of 1

Timestamp in Teradata

Posted: Thu Dec 30, 2004 12:54 pm
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

Posted: Thu Dec 30, 2004 3:21 pm
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.