| | |
|
|
|
* DATE IMPORT FORMAT TO ACCESS 97 * |
| message from =?Utf-8?B?Q2hyaXM=?= on 25 May 2004 |
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
|
| Jeff Boyce replied to =?Utf-8?B?Q2hyaXM=?= on 25 May 2004 |
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.
|
| Brian Kastel replied to =?Utf-8?B?Q2hyaXM=?= on 25 May 2004 |
Use the CVDate() function.
Your date appears to be in the format of DDMMYYHNN, which adds a minor
=== 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.
"Chris" <anonymous@discussions.microsoft.com> wrote...
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
|
|
Archived message: * DATE IMPORT FORMAT TO ACCESS 97 * (MS Access Database)