views:

24

answers:

1

I need to make an Access query output records that were only from last 24 hours. The field called " SYSADM_CUSTOMER_ORDER.CREATE_DATE" is the time-stamp field. I cant use the criteria ">date()-1", because that would give me records from after 12AM the previous day and I need to run the query at 4PM every day and only output records from after 4PM the previous day. Please give me the preoper SQL for me to copy and paste, based on my SQL below. thank you very much, Nathaniel

SELECT , SYSADM_CUSTOMER_ORDER.ID FROM SYSADM_CUSTOMER_ORDER;

A: 

I think you should probably be using now() - 1, something like:

select * from sysadm_customer_order where create_date > now() - 1;

The date function returns the date with an implicit time of 00:00:00. You want now() which gives you both current date and time.

paxdiablo