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!

 
I am not sure what DB2 Time stamp format is but we had to do the same thing using mySQL so we just created a functions class which among other things converted the date into the format required by mySQL
See below.

Public Class Functions




Public Function DateChange(ByVal intDate) As String





Dim intDay As String
Dim intMonth As String
Dim intYear As String

intDay = Day(intDate)
intMonth = Month(intDate)
intYear = Year(intDate)

'Get the day : parse method

Dim MyLen As Integer
MyLen = Len(intDay)
If MyLen = 1 Then intDay = "0" & intDay

'Get the month : parse method
MyLen = Len(intMonth)
If MyLen = 1 Then intMonth = "0" & intMonth

Dim dDate As String
dDate = (intYear & intMonth & intDay)

Return dDate



End Function



End Class

DotNetDoc
M.C.S.D.
---------------------------------------

Tell me and I forget. Show me and I remember. Involve me and I understand.
- Anonymous Chinese Proverb

-----------------------------------

If you can't explain it simply, you don't understand it well enough.
- A. Einstein





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top