比较MS Access SQL查询中的两个表

时间:2022-03-26 15:43:53

I have two Excel tables (A and B) with names of staff. I want to compare these two tables in MS Access.

我有两个Excel表(A和B),其中包含员工姓名。我想在MS Access中比较这两个表。

I have an Access query which compares a field like [Lastname, Firstname] and gave me as result for every member of Table A with no equivalent member in Table B. In my SQL query, Access made a simple string compare. For example:

我有一个Access查询,它比较[Lastname,Firstname]这样的字段,并给出了表A中每个成员的结果,表B中没有等效成员。在我的SQL查询中,Access进行了简单的字符串比较。例如:

SELECT User.A, User.B 
WHERE User.A Is Null

The problem is that the name with umlauten (ä,ü,ö,ß) are not written synchron in both tables. Sometimes I have ä or ae, ü or ue etc. Can I use regex in Access SQL to solve this problem?

问题是umlauten(ä,ü,ö,ß)的名称不会在两个表中同步写入。有时我有ä或ae,ü或ue等。我可以在Access SQL中使用正则表达式来解决这个问题吗?

Thanks for helping.

谢谢你的帮助。

1 个解决方案

#1


0  

The approach I would take is to translate the names into a standardized format, in a derived column in both table A and B. Then you can use this column for a simple string comparison.

我将采用的方法是在表A和表B中的派生列中将名称转换为标准格式。然后,您可以使用此列进行简单的字符串比较。

The translation can be accomplished using the replace function in Access.

可以使用Access中的替换功能完成转换。

#1


0  

The approach I would take is to translate the names into a standardized format, in a derived column in both table A and B. Then you can use this column for a simple string comparison.

我将采用的方法是在表A和表B中的派生列中将名称转换为标准格式。然后,您可以使用此列进行简单的字符串比较。

The translation can be accomplished using the replace function in Access.

可以使用Access中的替换功能完成转换。