this works for me
Code:
SELECT PK, CDate(Replace([dateDT],".","/",1,2)) AS Expr1
FROM Table1
WHERE (((CDate(Replace([dateDT],".","/",1,2)))>#3/25/2022#))
with this data
pk |
dateDT |
1 |
11.03.2022 23:59:03 |
2 |
12.03.2022 23:59:03 |
3 |
11.04.2022 23:59:03 |
returns
PK |
Expr1 |
3 |
11/04/2022 23:59:03 |
or use the datevalue function instead will exclude the time element
Code:
SELECT PK, datevalue(Replace([dateDT],".","/",1,2)) AS Expr1
FROM Table1
WHERE (((datevalue(Replace([dateDT],".","/",1,2)))>#3/25/2022#))
returns
as I mentioned before with sql date strings have to be in the format mm/dd/yyyy or yyyy-mm-dd so
WHERE format(cdate(replace(Field16,".","/",1,2)),"dd/mm/yyyy") > #20/03/2022#
will work (once your remove the format) for 20/03/2022 because sql is clever enough to know there are not 20 months in the year. but if the value was say 10/03/2022, that will be interpreted as 3rd October, not 10th March