I'm extracting records to a recordset and looping through each record.
I would like clarification on something as I'm not quite sure I have the correct Query.
My Table contains a DateTime Column formatted as EU General dd/mm/yyyy hh:nn:ss (We'll use 03/05/2015 00:00:01 for this example)
I'm using this DateTime in a sub query.
SQLstr = "Select * From Table2 Where [dDate] >= #" & rSet!DateTime &"#;"
which becomes "Select * From Table2 Where [dDate] >= #03/05/2015 00:00:01#;"
Due to Access' assumption that this is a US date format mm/dd/yyyy hh:nn:ss I get the incorrect results.
To fix this I have used "Select * From Table2 Where [dDate] >= CDate('" & rSet!DateTime &"');"
which becomes "Select * From Table2 Where [dDate] >= CDate('03/05/2015 00:00:01');"
But I am not sure that this is correct.
Do I have to use DateSerial to build the correct date or would formatting the Date to mm/dd/yyyy be sufficient?
I would like clarification on something as I'm not quite sure I have the correct Query.
My Table contains a DateTime Column formatted as EU General dd/mm/yyyy hh:nn:ss (We'll use 03/05/2015 00:00:01 for this example)
I'm using this DateTime in a sub query.
SQLstr = "Select * From Table2 Where [dDate] >= #" & rSet!DateTime &"#;"
which becomes "Select * From Table2 Where [dDate] >= #03/05/2015 00:00:01#;"
Due to Access' assumption that this is a US date format mm/dd/yyyy hh:nn:ss I get the incorrect results.
To fix this I have used "Select * From Table2 Where [dDate] >= CDate('" & rSet!DateTime &"');"
which becomes "Select * From Table2 Where [dDate] >= CDate('03/05/2015 00:00:01');"
But I am not sure that this is correct.
Do I have to use DateSerial to build the correct date or would formatting the Date to mm/dd/yyyy be sufficient?