I have multiple queries in a search form which when selected change the query in the data using QueryDefs.
Set Q = db.QueryDefs("QrySearchEventID")
Q.SQL = strSQLHadEvent
Q.Close
This works fine for the 3 main queries I need to change. These are all then used in a single query with Where ID in (Select ID from QrySearchEventID) etc etc.
These all work like clockwork BUT
One of the SQL statements, strSQLHadEvent, has
Select EventID from Events where EventDate between #" & strStart & "# and #" & StrEnd & "#
as the code. This looks fine in the debug window but by the time it gets into the queryDefs dates revert to US date format when the string shows them both in UK format. All the date formats are UK. dd/mm/yyy in the PC and server.
is there a way of forcing the date formats in access.
Set Q = db.QueryDefs("QrySearchEventID")
Q.SQL = strSQLHadEvent
Q.Close
This works fine for the 3 main queries I need to change. These are all then used in a single query with Where ID in (Select ID from QrySearchEventID) etc etc.
These all work like clockwork BUT
One of the SQL statements, strSQLHadEvent, has
Select EventID from Events where EventDate between #" & strStart & "# and #" & StrEnd & "#
as the code. This looks fine in the debug window but by the time it gets into the queryDefs dates revert to US date format when the string shows them both in UK format. All the date formats are UK. dd/mm/yyy in the PC and server.
is there a way of forcing the date formats in access.