我碰到了這個How Do I Sequentially Number Records in an Access Query 爲了做我想要做的事情基於這個stackoverflow question我發佈了(我從來沒有做過我以前做的事情)但每次我試圖AS計數器添加到查詢時,我得到在Access 2007中爲查詢添加表達式的正確語法(
The expression you entered contains invalid syntax
You may have entered an operand without an operator
使用下面的SQL:
SELECT Maintable.NumBR, Maintable.*, [Ehow] AS Expr1
FROM Maintable
WHERE (((Maintable.[NumBR])=""
Or (Maintable.[NumBR]) Like "3101"
Or (Maintable.[NumBR]) Like "3541"
Or (Maintable.[NumBR]) Like "4381"
Or (Maintable.[NumBR]) Like "AS3281"
Or (Maintable.[NumBR]) Like "4260"
Or (Maintable.[NumBR]) Like "4315"
Or (Maintable.[NumBR]) Like "4330"
Or (Maintable.[NumBR]) Like "4382"
Or (Maintable.[NumBR]) Like "9410"
Or (Maintable.[NumBR]) Like "9570"
Or (Maintable.[NumBR]) Like "AS3710"
Or (Maintable.[NumBR]) Like "AS4450"
Or (Maintable.[NumBR]) Like "K400"
Or (Maintable.[NumBR]) Like "3100"
Or (Maintable.[NumBR]) Like "3130"
Or (Maintable.[NumBR]) Like "3280"
Or (Maintable.[NumBR]) Like "3495"
Or (Maintable.[NumBR]) Like "3540"
Or (Maintable.[NumBR]) Like "3610"
Or (Maintable.[NumBR]) Like "3700"
Or (Maintable.[NumBR]) Like "4110"
Or (Maintable.[NumBR]) Like "4200")
AND (([Ehow])=DCount("[NumBR]","[Maintable]"," [NumBR] <= " & [NumBR])));
編輯在前面stackove提出的問題rflow問題回答了這個問題。
您對上傳的示例數據庫有什麼不瞭解?你應該發佈樣本數據和你想要返回的例子。 – Fionnuala 2012-08-13 19:53:12
我可以看到你有一個重複的id,當它應該有,但我不知道如何將id添加到找到的記錄。或者如何選擇然後添加一個ID – capnhud 2012-08-13 20:08:18
你看過查詢sql嗎? – Fionnuala 2012-08-13 20:09:37