date()-1\", b" />
开发者

time stamp field to output records from last 24 hours

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;


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜