I'm trying to write a sql to show all registered items on a specific date (let's say 2010/10/10):
1- tblTest is a linked table to SQL Server
2-Filtering field is RegisteredON. (Data type : datetime)
My first try:
No record is returned. Although I know I have several records with that date.
my Second try:
I receive a Data type mismatch in ceriteria expression Error
I know I can use the following but prefer not to (if there's another way)
Now my questions:
1- Why DateValue returns an error?
2- Is there any other way to filter a datetime field?
Thanks for any kind of advice
1- tblTest is a linked table to SQL Server
2-Filtering field is RegisteredON. (Data type : datetime)
My first try:
SQL:
SELECT * FROM tblTest WHERE [RegisteredON]=#2020/10/10#
my Second try:
SQL:
SELECT * FROM tblTest WHERE DateValue([RegisteredON])=#2020/10/10#
I know I can use the following but prefer not to (if there's another way)
SQL:
SELECT * FROM tblTest WHERE [RegisteredON] BETWEEN #2020/10/09# AND #2020/10/11#
SELECT * FROM tblTest WHERE [RegisteredON]>=#2020/10/10 0:0:0# AND [RegisteredON]<=#2020/10/10 23:59:59#
Now my questions:
1- Why DateValue returns an error?
2- Is there any other way to filter a datetime field?
Thanks for any kind of advice
Last edited: