B
Brian
Hello,
I have an Access table with
tmpReportIndex PgNo AcNo NumPgs
1 0010 0
2 0010 0
3 0108 0
4 0108 0
5 0108 0
6 0138 0
and I want an update query to give me
tmpReportIndex PgNo AcNo NumPgs
1 0010 2
2 0010 2
3 0108 3
4 0108 3
5 0108 3
6 0138 1
where NumPgs will be the number of times AcNo occurs.
I tried
UPDATE tmpReportIndex
SET NumPgs=(SELECT Count(t.AcNo) AS CountOfAcNo FROM tmpReportIndex AS t
WHERE t.AcNo = tmpReportIndex.AcNo)
but no joy. I know this will work in SQLServer.
Thanks for any help.
Brian
I have an Access table with
tmpReportIndex PgNo AcNo NumPgs
1 0010 0
2 0010 0
3 0108 0
4 0108 0
5 0108 0
6 0138 0
and I want an update query to give me
tmpReportIndex PgNo AcNo NumPgs
1 0010 2
2 0010 2
3 0108 3
4 0108 3
5 0108 3
6 0138 1
where NumPgs will be the number of times AcNo occurs.
I tried
UPDATE tmpReportIndex
SET NumPgs=(SELECT Count(t.AcNo) AS CountOfAcNo FROM tmpReportIndex AS t
WHERE t.AcNo = tmpReportIndex.AcNo)
but no joy. I know this will work in SQLServer.
Thanks for any help.
Brian