I think I'm approaching this problem wrong; I simply want to update the count of records in one table with the number of records in another.
TABLE1: ID, amount
TABLE2: ID, rec
I've tried...
UPDATE table1
SET amount=(SELECT COUNT(rec) FROM table2 WHERE table1.id=table2.rec);
and I tried...
UPDATE table1
SET amount=DCOUNT(rec,table2,rec=[id]);
I'm obviously missing something cos I get the "Too few parameters. Expected X" error for both of them!
Any Ideas?
Thanks in advance...
----------------------------------------
TABLE1: ID, amount
TABLE2: ID, rec
I've tried...
UPDATE table1
SET amount=(SELECT COUNT(rec) FROM table2 WHERE table1.id=table2.rec);
and I tried...
UPDATE table1
SET amount=DCOUNT(rec,table2,rec=[id]);
I'm obviously missing something cos I get the "Too few parameters. Expected X" error for both of them!
Any Ideas?
Thanks in advance...
----------------------------------------