Orders.DateReceived)=Date() yielded no results?

  • Thread starter Thread starter webbygeeza
  • Start date Start date
W

webbygeeza

Hello

Could someone please tell me why this isn't working? I have records that
were entered today but the query below yielded no results?
I am puzzled as I have another 2 queries to return all orders for this
month and year and they are both working.

SELECT Orders.ID, Orders.OrderRef, Orders.DateReceived
FROM Orders
WHERE (((Orders.DateReceived)=Date()));

Thanks in advanced.
 
webbygeeza said:
Hello

Could someone please tell me why this isn't working? I have records that
were entered today but the query below yielded no results?
I am puzzled as I have another 2 queries to return all orders for this
month and year and they are both working.

SELECT Orders.ID, Orders.OrderRef, Orders.DateReceived
FROM Orders
WHERE (((Orders.DateReceived)=Date()));

Thanks in advanced.

Just a hint, my Orders.DateReceived contains date and time.
 
webbygeeza said:
Could someone please tell me why this isn't working? I have records that
were entered today but the query below yielded no results?
I am puzzled as I have another 2 queries to return all orders for this
month and year and they are both working.

SELECT Orders.ID, Orders.OrderRef, Orders.DateReceived
FROM Orders
WHERE (((Orders.DateReceived)=Date()));


The Date function returns a time part of midnight, which is
unlikely to match the value in a field that's assigned a
value using the Now function.

You can use that DateValue function to ignore the time part:

WHERE DateValue(Orders.DateReceived) = Date()
 
Back
Top