HP3000-L Archives

March 2000, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Peter Chong <[log in to unmask]>
Reply To:
Peter Chong <[log in to unmask]>
Date:
Fri, 24 Mar 2000 11:18:55 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (56 lines)
Hi, Gary
 I posted this one before, but

Just copy this VBA to your Access| Modeule

VBA

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
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 ms format

Err_fConvertMsDate:
    Resume exit_fConvertMsDate

exit_fConvertMsDate:
    Exit Function
    
End Function



>>> Gary Nolan <[log in to unmask]> 03/24/00 05:11AM >>>
Hi Folks,

I am experimenting with ODBC/SE and have a dumb question. I have two fields
in a TurboIMAGE database.

DATE X 8   (yyyymmdd)
TIME X 6    (hhmmss)

How do I get ODBC - MS Access to understand that these are date and time
fields? Access seems to only understand these fields only when the date has
'/', and the time ':' in the data. I know I must be missing something
simple. Any suggestions would be appreciated.

Thanks
Gary Nolan
Sydney Steel Corporation

ATOM RSS1 RSS2