Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting Records

Status
Not open for further replies.

BeffyMar

Programmer
Jul 20, 2000
17
0
0
US
I have created a field that counts the records in a report but what I really want to do is count records with this twist.&nbsp;&nbsp;I want a count of all records that contain a negative in lapstime field and I want a count of all records that contain a positive in lapstime field.&nbsp;&nbsp;How would I accomplish this?<br><br>Thank you in advance,<br>Mary Beth
 
Hi Mary Beth,<br><br>Look up info on the DCount function, something like <br><br>=DCount(&quot;[CustomerID]&quot;,&quot;Customers&quot;,&quot;[lapstime]&lt;0&quot;)<br><br>should work as a Control Source of a textbox.<br><br>HTH,<br>Drew
 
I cant seem to get this to work...I will keep plugging away.<br><br>Any other suggestions would be greatly appreciated
 
What is showing up in the field?&nbsp;&nbsp;#Name? #Error, or the wrong number?
 
#error is showing up in the field.&nbsp;&nbsp;What I typed is:<br><br>=DCount(&quot;[Laps Time]&quot;,&quot;YearlyQry&quot;,&quot;[Laps Time]&lt;0&quot;)<br><br>I also substituted the first Laps Time for Person Responsible because that is what the footer was that it was in<br><br>The Name of the report used is &quot;Yearly Report&quot;<br>&quot;YearlyQry&quot; is the query that the report is created from...<br><br>Dont know if this helps but I sure hope that you can help.<br><br>I also tried setting an invisible control (Latecnt) with a control source:&nbsp;&nbsp;=iif([Laps Time] &lt; 0, 1, 0)<br>*** this part worked<br><br>but when I created a field in the footer and set its control source to =Sum([Latecnt]) it didnt recognize that Latecnt was a field and it prompted me for a value.<br><br>If you have any clues as to what I am doing wrong with either of these problems, please let me know... I am pulling hair out here...<br><br>Thank you once again,<br>Mary Beth
 
<br>I've kicked myself in the tail a few times for having a control which uses a calculation/formulae the same name as a field in the source table, is this what is happening?&nbsp;&nbsp;Can you set the control source for any field within the table or query the report is drawing from, in the control in question successfully?<br><br>
 
I figured it out... I just did iif statement within the query then calculated that field... I didnt realize that you couldnt sum a calc field... or something like that..<br><br>Thanks you for the advice.<br><br>Mary Beth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top