0

I have an MS-Access database with two tables, both containing a LongText field, Description. I want to union these tables and get the result in one dataset. The problem is that uinon trims the field values to 255 characters.

This is my query:

SELECT Description, LenBefore, Len(Description) AS LenAfter FROM (
  SELECT Description, Len(Description) AS LenBefore FROM References
UNION
  SELECT Description, Len(Description) AS LenBefore FROM KeyWords
)

The result:

enter image description here

The MDB file is in 2002-2003 file format, and I'm running this in MS-Access 2016 64x.

Is there any way that I can get the full text in one single query?

4

1 回答 1

1

进入查询 SQL 视图并将 UNION 更改为 UNION ALL。

在 UNION 中,必须对结果进行重复数据删除,这意味着进行比较。Access 只允许比较最多 255 个字符,因此会修剪该字段。UNION ALL 不需要重复数据删除,因此不会发生这种行为。

于 2018-01-05T09:52:23.827 回答