根据字段的值(空值或非空值)创建新的 table,仅在 Access 2010 中计算非空值

Depending on fields' value (null or not) create new table with calculations only on not null values in Access 2010

让我试着解释一下我想用这个 Access 2010 数据库做什么。

我只想根据 table 1 中插入的值创建第二个 table,仅使用 table 1 中具有值的行。所以在下面的示例中,我想要 table 2 只有 6 行计算。我知道如果 table 1 的字段为空值,我可以编写代码来隐藏字段,但这需要大量工作。我真的卡在这里了。

我不想存储 table 2 的数据。我只是想让它们显示在表格和报告中。谢谢。

让我回答我自己的问题,以防其他人有同样的需求。 因此,我使用了 UNION 查询并从 table 中选择了所有字段,同时丢弃了所有 NULL 字段。

SELECT id,pososto_symmetoxis11 FROM systades WHERE pososto_symmetoxis11 Is Not Null; UNION SELECT id,pososto_symmetoxis12 FROM systades WHERE pososto_symmetoxis12 Is Not Null; UNION 

因此 5x5 数组变成了具有 2 列的 table,空字段消失了。