DLookup上个月的条件

时间:2018-10-19 15:32:31

标签: ms-access

我有两个查询,第一个显示我将在报告中用作期末余额的金额余额。

我陷入困境的另一个查询应该显示期初余额。我收到这样的查询:

Edate By Month      closingbal      
April               $ 30000
May                 $ 25000
June                $ 27000

现在,我想要这样的查询:

Edate By Month      closingbal      
April               0
May                 30000
June                25000
July                27000

我一个月的DLookup条件部分有问题。

Closingbal: Dlookup("[closing balance]","qryclosingbalaance","Edate By Month" =<"[Edate By Month]")

1 个答案:

答案 0 :(得分:2)

字段具有空格,请使用[ ]<=不适用于月份名称。需要月份号。如果要保存月份名称,则需要转换为月份号。如果该字段实际上具有月份号,而它只是显示月份名称的查找,请尝试:

Closingbal: Dlookup("[closing balance]","qryclosingbalaance","[Edate By Month]=<" & [Edate By Month])