I want a calculated field to deduct one figure in one field, from a figure in another. But one of the fields needs to be grouped by another field! Its hard to explain, but in one table, I have a stock code. In another table I have orders for that stock item in various records. In another table I have a record for the items currently in stock.
I need to calculate the total number of items ordered for each stock item (done) and deduct from this the amount of stock items currently in stock. But when I do this, the query deducts the amount in stock from every record in the order table, where this should only be done once.
I was able to do this earlier by fiddling about, but I just cant seem to get it working again!
When using the Groupby function use the Expression as well
this tell the query to do the Groupby first then do the Expression Last
also make shour the Expression are at the End of the Query
Groupbys -> Sums ->Expression
when you group by and sum the new feild is name sumof.....
therefore the Expression should show the in the forumla GST: SumOftotal*.125
i would name then other wise you start getting umOfSumOftotal
hope this help
See clear as mud
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.