afterdigital
Programmer
Hi everyone,
i have 3 tables (table1 'customer', table2 'inventory', table 3 'orders'). I've created an orders report which consist of info from customers and inventory. When the report is viewed, each customer has all orders directly under him ( so the next customer has all orders directly under him and so forth). How can i calculate one field from many orders? Example would be 'number of items' in each order. Say there is 5 orders and each order has 'two items', that would be a total of 10.
I have tried the following:
<cfquery name="calculate" query="db">
select sum(item) as calitem
from table1, table2
where table1.customerid = table2.customerid
</cfquery>
I am using access as my database. Could my syntax be wrong. I've also tried queryofqueries but no success.
Thanks in advance for your replies...
Javier
NYC
i have 3 tables (table1 'customer', table2 'inventory', table 3 'orders'). I've created an orders report which consist of info from customers and inventory. When the report is viewed, each customer has all orders directly under him ( so the next customer has all orders directly under him and so forth). How can i calculate one field from many orders? Example would be 'number of items' in each order. Say there is 5 orders and each order has 'two items', that would be a total of 10.
I have tried the following:
<cfquery name="calculate" query="db">
select sum(item) as calitem
from table1, table2
where table1.customerid = table2.customerid
</cfquery>
I am using access as my database. Could my syntax be wrong. I've also tried queryofqueries but no success.
Thanks in advance for your replies...
Javier
NYC