By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,793 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,793 IT Pros & Developers. It's quick & easy.

Conditional Count

P: 69
Access 2003

Hi there, I have a query and a report and am wondering if there is a way to count a field (SRI) in the query or in the report if the condition of less than 7 days exists. I have a column in the query that specifies that if a row or line item is less than 7 days, then place a 1, else give it a 2.

Now, I need to make a count only the fields with a 1 assoicated with it.

Sure hope someone can help me.

Thank you VERY much for your time and assistance.
Aug 28 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 31,754
I suspect you want the Count() to be done in the Report as doing it in the query would leave the query unable to show any of the details for the items being counted.

A report TextBox control can be set to (assuming [YourDetailControl] is the control you use to store 1 or 2 in) :
Expand|Select|Wrap|Line Numbers
  1. =Sum([YourDetailControl]-1)
Aug 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.