Posted by Kim Wόrtz on 10/01/10 11:18
Hi folks
I have an C# app. connecting to a MS-ACCESS database with several tables.
In a specific situations I have problems with a DateTime type in a table.
The problem
is when I want to select records from a table in a specific period the day
and month
seems to be swapped in the query, but it only happens when the swapping
gives a
valid date eg.
12/10/2005 (12. Oct. 2005) returns records on 10/12/2005 (10. Dec. 2005)
23/05/2005 (23. May 2005) returns records correctly since 05/23/2005 is not
a valid date with danish regional settings.
The query is:
"SELECT [ID], [Activity], [BeginDate] FROM TimeReg WHERE [BeginDate] >= #" +
_start + "# " AND [BeginDate] <= #" + _end + "#"
_start and _end are of type DateTime
My PC in running with danish regional settings and if I shift to en-US
settings in the control panel, this
fixes the problem, but that is not a solution for me.
Any suggestions to solve this problem
Thanks in advance.
Kim W.
[Back to original message]
|