Subject: | |
From: | |
Reply To: | |
Date: | Wed, 15 Mar 2000 16:41:34 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Hi, Marilyn
We have COBOL Base ERP/MRP Package for Aerospace & Defense.
Internal Date format in the IMAGE is I2 and Date like 20000315 MS date will
be #03/15/2000#
I use ODBC/32 and MS Access
This function to extract I2 Date to MS Date
VBA Code
=======
Function fConvertMsdate(ByVal ODBCDate As Long) As Date
On Error GoTo Err_fConvertMsDate
' Function by Peter Chong PchQ45.Hotmail.com
' extract ODBC I2 like 20000101 to MS Date #01/01/2000#
Dim lngLen As Long, strOut As String, i As Long, _
strTmp As String, nbrOut As String, FirstNum As Boolean, _
EndNum As Boolean
FirstNum = True
EndNum = False
lngLen = Len(ODBCDate)
strTmp = CStr(ODBCDate)
strOut = ( _
Left(Right(strTmp, 4), 2) + "/" + _
Right(strTmp, 2) + "/" + _
Left(strTmp, 4) _
)
fConvertMsdate = CDate(strOut) 'mm/dd/yyyy format
Err_fConvertMsDate:
Resume exit_fConvertMsDate
exit_fConvertMsDate:
Exit Function
End Function
¯---
Peter Chong
Sr. ERP/MRP Analyst.
L3 Communications
714.956.9200 x 363
http://www.powerparagon.com
>>> Marilyn Salvas <[log in to unmask]> 03/15/00 01:25PM >>>
Hi,
I am exporting MANMAN data via ODBC into an ACCESS database - Now
the Dates are MANMAN integer Dates. Is there a formula to convert this
integer into something my users can recognize as a date?
Marilyn Salvas
|
|
|