3

我过去曾访问过同样的备忘录字段,并使用此处找到的注释来避免截断该字段。出于某种原因,我的新查询开始截断该Description字段,我无法找到导致截断的原因。

SELECT TableA.ID, Min(IIf([TableA].[YFLAG]="Y",[TableB].[CRHR],[TableA].[CRHR])) 
    AS [Min Credit], First(TableC.COU_DESC) AS Description
FROM (TableA LEFT JOIN TableC ON (TableA.END_DATE = TableC.END_DATE) AND 
    (TableA.ID = TableC.ID)) LEFT JOIN TableB ON TableA.ID = TableB.ID
GROUP BY TableA.ID
HAVING (((Min(IIf([TableA].[YFLAG]="Y",[TableB].[CRHR],[TableA].[CRHR])))>0));

我已将问题缩小到Having语句,但不知道如何解决。

4

1 回答 1

1

我想知道使用这样的工会是否可行

SELECT TableA.ID,0 AS [Min Credit],TableC.COU_DESC AS Description WHERE (FALSE)
Union All
SELECT TableA.ID, Min(IIf([TableA].[YFLAG]="Y",[TableB].[CRHR],[TableA].[CRHR])) 
    AS [Min Credit], First(TableC.COU_DESC) AS Description
FROM (TableA LEFT JOIN TableC ON (TableA.END_DATE = TableC.END_DATE) AND 
    (TableA.ID = TableC.ID)) LEFT JOIN TableB ON TableA.ID = TableB.ID
GROUP BY TableA.ID
HAVING (((Min(IIf([TableA].[YFLAG]="Y",[TableB].[CRHR],[TableA].[CRHR])))>0));

这种“联合所有”会根据您共享的链接诱使 Access 保留整个备注字段。

于 2012-12-18T20:13:48.963 回答