Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calculating Totals

0 views
Skip to first unread message

Maarten

unread,
Jan 24, 2002, 12:56:24 PM1/24/02
to

Hi,

Have table offertelijnen with the field offertelijn_id
Have table offertelijnenDetails with the field offertelijnD_offertelijnid

Exemple offertelijnen
offertelijn_id = 67
offertelijn_vkp (the total of all vkp in offertelijnDetails)
offertelijn_group = "materials"

Exemple offertelijnenDetails

offertelijnD_offertelijnid = 67
offertelijnD_article = "aaa"
offertelijnD_vkp = 1000

offertelijnD_offertelijnid = 67
offertelijnD_article = "bbb"
offertelijnD_vkp = 2000

offertelijnD_offertelijnid = 67
offertelijnD_article = "ccc"
offertelijnD_vkp = 3000

My intention is to recalculate the total of all offertelijnD_vkp when the
price has changed of 1 detail.
I wish to calculate the total of all offertelijnD_vkp (1000+2000+3000) and
try put 6000 in offertelijn_vkp

sqlTxt = "UPDATE offertelijnen SET offertelijn_vkp = (SELECT
sum(offertelijnD_vkp) FROM offertelijnenDetail WHERE
offertelijnD_offertelijnId = offertelijn_id)"

If i run the sql i get error "query must be updatable"

Any idea how i can do this ?
Thanks - Maarten - Belgium (NL)

0 new messages