Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timestamp returning null?

Status
Not open for further replies.

jisoo23

Programmer
Jan 27, 2004
192
US
I've got a strange problem going on. I have a value that I'm pulling from a flat file which is actually a timestamp (i.e. HH:MM:SS) but is brought in as a string. I use this function to turn it into a timestamp (not date/time stamp):

To_Date(variable,'HH24MISS')

But it returns a null everytime. I've tried to bring it in as both string and a datetimestamp but still get the same result. Has anyone else run into this kind of problem before? The target is a time field on a DB2 table.

Thanks,
Jisoo23
 
Jisoo,

If I use a flatfile with the time-part as following string:

Code:
 17:34:11

then the following expression does the job:

Code:
 TO_DATE(variable,'HH24:MI:SS')

You may need to use a SUBSTR action to get the time-part from the string first (my guess)

Ties Blom
Information analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top