我正在尝试创建一个基本上充当配对服务的数据库。我有两个具有相同类别的表,Clients
和Opportunities
。
我们的想法是在我们获取它们时输入买方Clients
,填写适用的描述性字段(EBITDA
,Gross Revenue
等)。
然后,当出现可能的Opportunity
时,我会在相应的表格中输入该信息(EBITDA
,Gross Revenue
等)。
然后,我们的想法是按照优先顺序运行一个基本上将来自Clients
的记录与来自Opportunities
的记录“匹配”的查询,即具有最匹配字段的项目排在最前面。
所以我创建了表格(Clients
和Opportunities
),第三个表格Values
,其中包含几个字段的可能选项,以及用于输入信息的表格Opportunities
和Clients
。
我在Opportunities
和Clients
表中输入了一个测试记录,其中有几个匹配的字段。但我的查询没有返回任何命中。根据我收到的一些建议,我尝试添加一些SQL代码来解决可能的NULL问题,但Access不接受代码。可以写这个查询吗?我正在寻找可能的结果吗?
使用向导设计的我的查询看起来像这样并且不返回任何匹配,尽管每个表中的示例记录具有匹配的条目:
SELECT Clients.*, Opportunities.*
FROM Clients INNER JOIN Opportunities
ON (Clients.[NAICS Sector Codes]=Opportunities.[NAICS Sector Codes])
AND (Clients.[Business Model]=Opportunities.[Business Model])
AND (Clients.[Gross Revenue]=Opportunities.[Gross Revenue])
AND (Clients.EBITDA=Opportunities.EBITDA)
AND (Clients.[EBITDA Margin (%)]=Opportunities.[EBITDA Margin (%)])
AND (Clients.[Growth-Timeframe in Years]=Opportunities.[Growth-Timeframe in Years])
AND (Clients.[Growth-Revenue]=Opportunities.[Growth-Revenue])
AND (Clients.[Growth-EBITDA (%)]=Opportunities.[Growth-EBITDA (%)])
AND (Clients.[Geographical Operational Location Preference]=Opportunities.[Geographical Operational Location Preference])
AND (Clients.[Debt Load]=Opportunities.[Debt Load])
AND (Clients.[Primary Area of Sales Concentration (Geographic)]=Opportunities.[Primary Area of Sales Concentration (Geographic)])
AND (Clients.[% of total revenue from ≤ top 3 customers]=Opportunities.[% of total revenue from ≤ top 3 customers])
AND (Clients.[% of total revenue from ≤ top 10 customers]=Opportunities.[% of total revenue from ≤ top 10 customers])
AND (Clients.[% of total revenue from ≤ top 20 customers]=Opportunities.[% of total revenue from ≤ top 20 customers])
AND (Clients.[Current Management Post-Transaction Plan]=Opportunities.[Current Management Post-Transaction Plan])
AND (Clients.[Preferred Deal Structure]=Opportunities.[Preferred Deal Structure]) AND (Clients.NAPCS=Opportunities.NAPCS)
AND (Clients.Notes=Opportunities.Notes)
AND (Clients.[ZLD Sector Notes]=Opportunities.[ZLD Sector Notes]);