i know this has been covered a lot, but i cant get any of the solutions ive tried to work.
i have a type
i read values from a SQLite database (1 table, 4 columns)
the date comes from the SQLite DB in the form of
now, i need to format this string and save it to an Access DB. i believe that Access is a bit awkward and requires american mm/dd/yyyy format, so i format my string for that.
however when i look at the Date in the watches window, the string is turned into the uk format dd/mm/yyyy.
i store the date into accesss using the folowing SQL string
(also tried using CDate() and removing the # signs but to no avail)
also when i look at my acess DB, depending on the value of the day, the Database is half and half mm/dd/yyyy and dd/mm/yyyy
for example
eventualy this leads to erattic results when trying to retrieve rows on certain days.
(ie is 01/10/2005 or 10/01/2005 the value i want)
so i guess the question is, what is the best way of working with dates when writing to an access DB?
any input apreciated, this is driving me crazy
If somethings hard to do, its not worth doing - Homer Simpson
i have a type
Code:
Public Type HandData
g_HandID As Long
g_HandDate As Date
g_WasSeated As Boolean
g_XMLDump As String
End Type
Public Hands() As HandData
i read values from a SQLite database (1 table, 4 columns)
the date comes from the SQLite DB in the form of
Code:
"20050829153629"
now, i need to format this string and save it to an Access DB. i believe that Access is a bit awkward and requires american mm/dd/yyyy format, so i format my string for that.
Code:
Hands(iCnt).g_HandDate=Mid(rs.ColumnValue(1), 7, 2) & "/" & Mid(rs.ColumnValue(1), 5, 2) & _
"/" & Mid(rs.ColumnValue(1), 1, 4) & " " & Mid(rs.ColumnValue(1), 9, 2) & _
":" & Mid(rs.ColumnValue(1), 11, 2) & ":" & Mid(rs.ColumnValue(1), 13, 2)
however when i look at the Date in the watches window, the string is turned into the uk format dd/mm/yyyy.
Code:
#29/08/2005 15:36:29#
i store the date into accesss using the folowing SQL string
Code:
sqlStr="INSERT INTO HandData (HandID,HandDate,WasSeated) VALUES (" & CLng(Hands(i).g_HandID) & ",#" & Hands(i).g_HandDate & "#," & Hands(i).g_WasSeated & ")"
(also tried using CDate() and removing the # signs but to no avail)
also when i look at my acess DB, depending on the value of the day, the Database is half and half mm/dd/yyyy and dd/mm/yyyy
for example
Code:
30/08/2005 23:42:35
09/01/2005 18:32:13
eventualy this leads to erattic results when trying to retrieve rows on certain days.
(ie is 01/10/2005 or 10/01/2005 the value i want)
so i guess the question is, what is the best way of working with dates when writing to an access DB?
any input apreciated, this is driving me crazy
If somethings hard to do, its not worth doing - Homer Simpson