【问题标题】:Query with checkbox and combobox in Access Database在 Access 数据库中使用复选框和组合框进行查询
【发布时间】:2023-03-19 18:56:01
【问题描述】:

下午好 这是我的查询:

SELECT Reference.quote_date AS [Quote Date]
  , Reference.agent_ID AS Agent
  , Reference.ref_ID AS ReferenceID
  , Reference.ref_number AS [Ref Number]
  , Customer.title_id AS Title
  , Customer.name AS Name
  , Customer.surname AS Surname
  , Customer.postcode AS Postcode
  , Customer.telephone AS Telephone
  , Reference.location_ID AS Location
  , Reference.policy_ID AS Product
  , Reference.price AS Price
  , Reference.status_ID AS Status
  , Reference.source_ID AS Source
  , Reference.calltype_ID AS [Call Type]
  , Reference.prize_draw AS [Prize Draw]
  , Reference.Call_back_date AS [Call back date]
  , Reference.call_back AS [Call back]
  , Reference.IsCompleted AS Completed
  , Reference.comments AS Comments
FROM Customer INNER JOIN Reference 
  ON Customer.[customer_ID] = Reference.[customer_ID]
WHERE (((Reference.agent_ID)=[Forms]![Call_Back_Search1]![Combo5]) 
  AND ((Reference.Call_back_date) 
    Between [Forms]![Call_Back_Search1]![StartDateTxt] And [Forms]![Call_Back_Search1]![EndDatetxt]));

它目前显示在 Call_Back_Search1 表单中选择的特定条件内的所有回调: - 日期标准:在开始和日期之间:结束 - 并允许选择代理 (Combobox05)。 我希望在我的查询中添加其他条件:
名为“已完成”的复选框未被勾选 - 仅根据所选日期范围显示结果(将组合框留空)
想知道我是否可以向您提出任何建议 谢谢你

【问题讨论】:

  • 请阅读stackoverflow.com/help/formatting 并编辑您的问题以便更好地阅读。
  • 您将查询放在哪里?表单对象的控制源?它是一个子窗体吗?请说明您对复选框的期望用途。
  • 嗨@ChristopherD。我实际上设法自己解决了这个问题。

标签: sql ms-access checkbox combobox ms-access-2010


【解决方案1】:

我希望有人会发现我的回答有用 代码如下:

SELECT Reference.quote_date AS [Quote Date], Reference.agent_ID AS Agent, Reference.ref_ID AS ReferenceID, Reference.ref_number AS [Ref Number], Customer.title_id AS Title, Customer.name AS Name, Customer.surname AS Surname, Customer.postcode AS Postcode, Customer.telephone AS Telephone, Reference.location_ID AS Location, Reference.policy_ID AS Product, Reference.price AS Price, Reference.status_ID AS Status, Reference.source_ID AS Source, Reference.calltype_ID AS [Call Type], Reference.prize_draw AS [抽奖], Reference.Call_back_date AS [回拨日期], Reference.call_back AS [回拨], Reference.cmets AS Comments, Reference.IsCompleted FROM Customer INNER JOIN Reference ON Customer.[customer_ID] = Reference.[customer_ID] WHERE IIF(IsNull(Forms!Call_Back_Search1!Combo5),True,(Reference.agent_ID)=Forms!Call_Back_Search1!Combo5) 和 ((Reference.Call_back_date) 在表单之间!Call_Back_Search1!StartDateTxt 和 Forms!Call_Back_Search1!EndDatetxt) 和 (([ Reference.IsCompleted])=0);

【讨论】:

    猜你喜欢
    • 2012-09-16
    • 1970-01-01
    • 1970-01-01
    • 2020-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多