B
bert
Hi All,
I try to make a running total for the stock of parts in our company.
We have a table sales
and a table purchases
I combined those two tables with union select to get all incoming and
outgoing numbers for the parts in ONE table, incoming positive and
outgoing negative.
Finally I make a table called tmp of this union select query.
Then This goes wrong, I try to use DSUM in a query to get the running
totals of our stock.
Stock: DSum("hoeveelheidinkoop";"tmp";"#[inkoopdatum]#<=" &
"#[inkoopdatumalias]#" & "")
"hoeveelheidinkoop" = the qty
"tmp"= my table
#[inkoopdatum]# - my date field
the #[inkoopdatumaliasis]# just the alias of the date
Hope I am clear of what I'm trying to accomplish
Thanks, Bert
PS: the sql for this one:
SELECT tmp.PartID, tmp.inkoopdatum AS inkoopdatuma,
Sum(tmp.hoeveelheidinkoop) AS SomVanhoeveelheidinkoop,
DSum("hoeveelheidinkoop","tmp","#[inkoopdatum]#<=" &
"#[inkoopdatuma]#" & "") AS voorraad
FROM tmp
GROUP BY tmp.PartID, tmp.inkoopdatum;
I try to make a running total for the stock of parts in our company.
We have a table sales
and a table purchases
I combined those two tables with union select to get all incoming and
outgoing numbers for the parts in ONE table, incoming positive and
outgoing negative.
Finally I make a table called tmp of this union select query.
Then This goes wrong, I try to use DSUM in a query to get the running
totals of our stock.
Stock: DSum("hoeveelheidinkoop";"tmp";"#[inkoopdatum]#<=" &
"#[inkoopdatumalias]#" & "")
"hoeveelheidinkoop" = the qty
"tmp"= my table
#[inkoopdatum]# - my date field
the #[inkoopdatumaliasis]# just the alias of the date
Hope I am clear of what I'm trying to accomplish
Thanks, Bert
PS: the sql for this one:
SELECT tmp.PartID, tmp.inkoopdatum AS inkoopdatuma,
Sum(tmp.hoeveelheidinkoop) AS SomVanhoeveelheidinkoop,
DSum("hoeveelheidinkoop","tmp","#[inkoopdatum]#<=" &
"#[inkoopdatuma]#" & "") AS voorraad
FROM tmp
GROUP BY tmp.PartID, tmp.inkoopdatum;