我想查询4天前的订单信息。不过,我不能完全让查询使用全天 24 小时:
<cfquery name="rsByDate" datasource="#request.dsn#">
SELECT tbl_customers.cst_FirstName
, tbl_customers.cst_LastName
, tbl_customers.cst_Email
, tbl_orders.order_ID
, tbl_orders.order_Date
FROM tbl_customers INNER JOIN tbl_orders
ON tbl_customers.cst_ID = tbl_orders.order_CustomerID
WHERE tbl_orders.order_Date >= #CreateODBCDateTime(DateAdd("d",-5,Now()))#
AND tbl_orders.order_Date <= #CreateODBCDateTime(DateAdd("d",-4,Now()))#
AND order_Status = 3
ORDER BY tbl_orders.order_Date DESC
</cfquery>
我希望实现的是执行此查询,然后cfmail
在客户的订单被标记为状态 3“已发货”四天后要求客户对我们进行审查。
我想我的日期设置不太正确。我哪里错了?