* DATE IMPORT FORMAT TO ACCESS 97 *

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello can you help

I am trying to import a Touchpaper (Helpdesk) date table into Access 97
The sort of format the dates are in are is as follows: 13120591

Does anyone know how to convert this to a standard Access date format

Regard
Chris
 
Chris

Can you describe what "131205912" is equivalent to in "real" date/time? And
how you (manually) convert it?

Access has numerous functions you can use in a query to parse pieces of a
string and to create a date field value.
 
Use the CVDate() function.

Your date appears to be in the format of DDMMYYHNN, which adds a minor
complication since the number of digits for the hour can vary. Here is one
way to parse it:

=== START OF CODE ===============

Public Function ConvertDateString(ByRef ds As String) As Date

'Expects a date string in the format of DDMMYYHNN

Dim m As String
Dim d As String
Dim y As String
Dim h As String
Dim n As String

m = Mid$(ds, 3, 2)
d = Mid$(ds, 1, 2)
y = Mid$(ds, 5, 2)
h = Mid$(ds, 7, 2 - (10 - Len(ds)))
n = Right$(ds, 2)

ConvertDateString = CVDate(m & "/" & d & "/" & y & " " & h & ":" & n)

End Function

=== END OF CODE ===============

Create a Date/Time field in your imported table, and create an update query
that sets this field by calling the function using the original field as the
parameter.


Hello can you help?

I am trying to import a Touchpaper (Helpdesk) date table into Access 97.
The sort of format the dates are in are is as follows: 131205913

Does anyone know how to convert this to a standard Access date format?

Regards
Chris
 
Back
Top