I have a query for an inventory catalog that looks like this.
select RIGHT(C.barcode, 12), C.description, C.size, (select sum(stock_count) from count_update where barcode = RIGHT(C.barcode, 12)) TotalCount, (select stock_count from count_update where barcode = RIGHT(C.barcode,12))-(select inventory from current_inv where barcode = C.barcode) Variance, ((select stock_count from count_update where barcode = RIGHT(C.barcode,12))-(select inventory from current_inv where barcode = C.barcode))*(select cost from current_inv where barcode = C.barcode) MoneyVar
from current_inv c
ORDER BY (select _rowid from print_inv_sheets where barcode = C.barcode);
Which returns barcode numbers, item description and size, variance for each item from the last reconciliation, and how much each variance costs.
What i would like to do is also have a total sum of all count variances and money variances for all items in the catalog.
Any suggestions?
Thanks in advance.
Darron
select RIGHT(C.barcode, 12), C.description, C.size, (select sum(stock_count) from count_update where barcode = RIGHT(C.barcode, 12)) TotalCount, (select stock_count from count_update where barcode = RIGHT(C.barcode,12))-(select inventory from current_inv where barcode = C.barcode) Variance, ((select stock_count from count_update where barcode = RIGHT(C.barcode,12))-(select inventory from current_inv where barcode = C.barcode))*(select cost from current_inv where barcode = C.barcode) MoneyVar
from current_inv c
ORDER BY (select _rowid from print_inv_sheets where barcode = C.barcode);
Which returns barcode numbers, item description and size, variance for each item from the last reconciliation, and how much each variance costs.
What i would like to do is also have a total sum of all count variances and money variances for all items in the catalog.
Any suggestions?
Thanks in advance.
Darron