This one should prob be easy for you access pro's whereas I am not...yet.
Simply put, within a report I have a field populated with numeric data such as 12,26,52. These numbers represent length of contract commitment in weeks. In a sort order these are listed and broken down by sales office. Essentially I may have say 3 listed, under a sales office of say 12,12,52, and what I want is a field in the report detail that sum's the number of contracts in this example 2:12 week contracts and one 52.
I cannot use a subreport as they want it all on one report, as for the sum, if I use that formula it will total the 12, 12, 52 and give me 76 where as I need one field saying there is 2 12's and one 52.
Actually I think I see what its doing or rather whats wrong with my formula, since it meets the if statment true and sees the 52 its counting all the fields to total 3 (12,12,52)rather than seeing the 52 and counting 1 as there is only one 52
Actually, I tried the formula =DCount("[CNCOMM]","PCONTMST Active","52") and got the number 2030, problem being is I am sorting by sales office and it looks as though it calculated the total number of 52's rather than just the ones under the particular sales office within the header.
with dcount you make a global table count. it is not based on your report query.
in criteria section of function you should enter a valid WHERE clause there (without WHERE keyword) to calculate your count. Like;
=DCount("[CNCOMM]","PCONTMST Active","[CNCOMM]=52 AND [SALES OFFICE]=4")
I don't know your table structure though. That was just an example. and for sales office field you can use the data on your report instead of absoulte numbers like 4.