Discussion:
update a sum between two tables in ado vb6
(too old to reply)
c***@gmail.com
2017-08-04 13:42:46 UTC
Permalink
Hello my friends

I am building an account-program, for that:

I want to update a field in an access table.
The field should add the value in tableR.bedrag
with the sum in tabelb.bedrag in a certain periode
A bit like this:

Update TableB set Bedrag = TableR.Bedrag + SUm(tableB.bedrag) where datum between fromdate and todate.

where TabelR.bedrag is the value from a previous periode, written in tabelR

Any Idea?

Thanks in advance

Catharinus
c***@gmail.com
2017-08-04 13:58:07 UTC
Permalink
Post by c***@gmail.com
Hello my friends
I want to update a field in an access table.
The field should add the value in tableR.bedrag
with the sum in tabelb.bedrag in a certain periode
Update TableB set Bedrag = TableR.Bedrag + SUm(tableB.bedrag) where datum between fromdate and todate.
where TabelR.bedrag is the value from a previous periode, written in tabelR
Any Idea?
Thanks in advance
Catharinus
And I forgot something to mention:
The Two tables are joins via the field tabelr.reken and tabelb.reken
Erland Sommarskog
2017-08-04 19:19:17 UTC
Permalink
Post by c***@gmail.com
I want to update a field in an access table.
The field should add the value in tableR.bedrag
with the sum in tabelb.bedrag in a certain periode
Update TableB set Bedrag = TableR.Bedrag + SUm(tableB.bedrag) where datum
between fromdate and todate.
where TabelR.bedrag is the value from a previous periode, written in tabelR
If we overlook that this forum/newsgroup is dead, the scope for this
newsgroup is SQL Server, and you talk about Access. I would recommend
that you find an Access forum to answer the question. While both SQL Server
and Access use SQL, there are considerable differences between the two.
--
Erland Sommarskog, Stockholm, ***@sommarskog.se
Loading...