按日期查询数据库 [英] Querying database by date
问题描述
我是Access的新手,特别是查询,我需要查询显示过去3个月内没有下订单的所有客户;
i有以下表格
tblCustomers
tblOrderLine
tblOrders
日期在表格订单中。
任何帮助都会很棒,谢谢!
Hi,
I''m relatively new to Access, in particular Queries, I need to do a query that displays all customers who havent placed an order within the last 3 months;
i have the following tables
tblCustomers
tblOrderLine
tblOrders
the date is in the table Orders.
Any help would be great, thanks!
推荐答案
(月(日期()) - 月([DateOfLastOrder]))> = 3
(Month(Date()) - Month([DateOfLastOrder])) >= 3
(月(日期()) - 月([DateOfLastOrder]))> = 3
(Month(Date()) - Month([DateOfLastOrder])) >= 3
非常感谢你的帮助,还有一件我不明白的事情,我会把它放在哪里?!我尝试使用查询,但我不明白这将如何生成一个报告,其中包含过去3个月内未订购的客户名单...
Thanks a lot for your help, just one more thing i dont understand, where would i put this?! i tried using queries but i dont understand how this will generate a report with a list of names of customers who havent ordered in the last 3 months...
我对Access相对较新,特别是查询,我需要查询显示过去3个月内没有下订单的所有客户;
i有以下表格
tblCustomers
tblOrderLine
tblOrders
日期在表格订单中。
任何帮助都会很棒,谢谢!
Hi,
I''m relatively new to Access, in particular Queries, I need to do a query that displays all customers who havent placed an order within the last 3 months;
i have the following tables
tblCustomers
tblOrderLine
tblOrders
the date is in the table Orders.
Any help would be great, thanks!
如果没有更多信息,我必须做出一些假设。 tblOrders有一个CustID的外键,是tblCustomers的主键。我不知道我们需要tblOrderLine,我假设它包含订单详情。
Without more information I have to make some assumptions. tblOrders has a foreign key to CustID the primary key of tblCustomers. Don''t know that we need tblOrderLine, which I assume contains order details.
这篇关于按日期查询数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!