0

我正在做两个查询的联合。

查询单独运行没有问题,但联合抛出此查询。有任何想法吗?

查询是

SELECT CStr([REFERENCE]) AS CostID,CSng([R​​ATE]) AS HRates FROM [Qry 1 项目预算 pt1 人工费率] UNION ALL SELECT CStr([REFERENCE]),CSng([R​​ate]) FROM [Qry 1 项目预算pt2 第 3 方];

访问 2007

4

1 回答 1

1

两者都CStr()CSng()抛出 Null 错误。检查您的任何[REFERENCE][RATE]值是否为空。

SELECT
    [REFERENCE],
    [RATE]
FROM [Qry 1 Project Budget pt1 labour rates]
WHERE [REFERENCE] Is Null OR [RATE] Is Null
UNION ALL
SELECT
    [REFERENCE],
    [Rate]
FROM [Qry 1 Project Budget pt2 3rd party]
WHERE [REFERENCE] Is Null OR [RATE] Is Null;
于 2013-04-17T14:07:34.343 回答