Reputation: 5
Please help me to compare two datetime values with WHERE clause in access.
Problem is one datetime format is in German e.g 12.03.2015 4:33:40 PM while other is in US format 12/3/2015 4:33:40 PM.
What i tried:
SELECT *
FROM Contacts
WHERE (((Format([Edit Date],"mm/dd/yyyy hh:nn:ss AM/PM")) > #11/28/2016 12:31:30#));
Upvotes: 0
Views: 7781
Reputation: 838
If the [Edit Date]
column is in Date/Time format, you just need normal comparison. Maybe the problem lies in the way you try to supply date in between #? Try:
SELECT *
FROM Contacts
WHERE [Edit Date] > DateSerial(2016, 11, 28) + TimeSerial(12,31,30);
Or
SELECT *
FROM Contacts
WHERE [Edit Date] > #2016-11-28 12:31:30#;
Upvotes: 5