[snip]
sqltext2 = "Select sum(orders.amount * products.price) AS total from
orders,products where orders.product=products.productid AND cluster = '" &
cluster & "'and orderdate > '" & printdate & "';"
[/snip]

If the query conditioals are the same for both queries you can just include
sum(orders.amount * products.price) AS total in your SELECT statement. If
the conditionals are not, you would have to modify. An example;

SELECT orderID, product, quantity, price, SUM(quantity * price) AS Extended
FROM orders, products
WHERE orderID etc., etc, etc...

Your returned items would be orderID, product, quantity, price, and
Extended.

HTH!

Jay




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to