执行Update查询后Access中条目无法被Select查询找到
Access更新查询后筛选失效问题
我在Microsoft Access中创建了一个Update查询,用于将所有标记为"HA"的条目更新为指定销售代表的姓名。该查询关联SalesReps表,需输入销售代表编号来更新主表的SalesRep字段(主表中该字段为组合框)。更新功能运行正常,但当使用另一个用于筛选指定销售代表相关条目的Select查询时,所有通过手动或Update查询修改过的条目都无法被Select查询及搜索功能找到。
Update查询SQL语句
UPDATE Invoices SET Invoices.SalesRep = [SalesReps].[SalesRep] WHERE (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyA")) OR (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyB")) OR (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyC")) OR (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyD")) OR (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyE")) OR (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyF")) OR (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyG")) OR (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyH")) OR (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyI") AND ((Invoices.[Invoice Number]) Like "AN*")) OR (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyI") AND ((Invoices.[Invoice Number]) Like "ME*")) OR (((Invoices.SalesRep)="HA") AND ((Invoices.[Customer Name])="CompanyH") AND ((Invoices.[Invoice Number]) Like "ME*"));
Select查询SQL语句
SELECT [Q-ALL UNSIGNED Invoices SIGREQ].[Customer Name], [Q-ALL UNSIGNED Invoices SIGREQ].[Invoice Date], [Q-ALL UNSIGNED Invoices SIGREQ].[Invoice Number], [Q-ALL UNSIGNED Invoices SIGREQ].[Invoice Amount], [Q-ALL UNSIGNED Invoices SIGREQ].[Out Date], [Q-ALL UNSIGNED Invoices SIGREQ].[In Date], [Q-ALL UNSIGNED Invoices SIGREQ].SalesRep FROM [Q-ALL UNSIGNED Invoices SIGREQ] WHERE ((([Q-ALL UNSIGNED Invoices SIGREQ].[Customer Name])=[Enter Customer Name]) AND (([Q-ALL UNSIGNED Invoices SIGREQ].[Invoice Number]) Like [Enter 2-Letter Department] & "*") AND (([Q-ALL UNSIGNED Invoices SIGREQ].[Out Date])>=[Start Date] And ([Q-ALL UNSIGNED Invoices SIGREQ].[Out Date])<=[End Date]) AND (([Q-ALL UNSIGNED Invoices SIGREQ].[In Date]) Is Null) AND (([Q-ALL UNSIGNED Invoices SIGREQ].SalesRep)=[Enter SalesRep Name])) ORDER BY [Q-ALL UNSIGNED Invoices SIGREQ].[Invoice Date], [Q-ALL UNSIGNED Invoices SIGREQ].[Invoice Number];
已尝试修改字段值、手动编辑名称、复制可被找到的条目内容、删除并重写条目,但问题仍未解决。
内容的提问来源于stack exchange,提问作者Sterling Drake
相关产品推荐
相关产品推荐

