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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting SQL timestamp to DB2....anyone with any

Status
Not open for further replies.

jcash35010

Programmer
Jul 22, 2003
21
0
0
US
suggestions? I have the timestamp from SQL which I need to convert to enter into DB2 format timestamp. Does anyone know how to do this? I've tried several different things, and so far nothing works...

any help is greatly appreciated!
 
Is this a timestamp or datetime?
If it's a timestamp (or rowversion) then it's just dependent on the tr log entries and is binary(8).

If it's a datetime you may have to convert. Be cautious about the accuracy of the db2 dtatype compared to the sql server version.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Its datetime, and I am not sure as to how to convert it.
 
I found a way to convert it. In my vb code in the SQL statement to insert or update the DB2 table I use
timestamp_format(SQLdatefield, 'YYYY-MM-DD HH24:MI:SS').

example:
timestamp_format('2003-10-28 10:52:01','YYYY-MM-DD HH24:MI:SS')

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top