DCount error

  • Thread starter Thread starter jeanna
  • Start date Start date
J

jeanna

Guest
I am trying to design a report that is based on a query called "qry trip" which filters the records in the "Trip" table by date.

I used the following expression:

=DCount("[Chief Complaint]","Trip","[Chief Complaint] = 'C'")

I want to count the number of instances where the Chief Complaint is equal to "C", but instead of returning the number of instances within the specified date range, it returns all the instances in the table "Trip".

I tried to change "Trip" to "qry trip" but I keep getting an error message. So that I have:

=DCount("[Chief Complaint]","qry trip","[Chief Complaint] = 'C'")

Can anyone help me?
 
Because the Chief Complaint field has either "C", "I", or "A". I only want to count the records in the report where Chief Complaint = "C"

But the expression I used counts all the records in the database where Chief Complaint is "C"
 
Because the I am counting the number of instances where Chief Complaint is "C".

I tried to use the count function but it didn't work because this field isn't a number
 
I don't know that I have an answer, btu I think I'm trying to do somethign similar.

Can you explain the syntax?

I can'd find anything in help on the D* commands.

Thanks.
 
What is the syntax to use the above formula, but to specify NOT a specific value.

For example, what if she wanted all values EXCEPT C?

Thanks.

Gayle Ann
 
What is the syntax to use the above formula, but to specify NOT a specific value.

For example, what if she wanted all values EXCEPT C?

Thanks.

Gayle Ann
 
I tried the syntax you suggested and when I open up the report it asks me to enter a parameter for Chief Complaint.

This is not what I am trying to do though.

The database has a table called Trip. The primary key is trip_ID#. And the other fields are trip_date, Chief Complaint, Pt Demographics, Call Origin, Odometer Readings etc. Each one of the fields (except for trip_ID# and trip_date) can have a value of either "C","A","I" or "N/A".

I then made a query that contains all these fields but prompts the user to enter dates. From this query, I made a report. The report lists each record within the specified dates by trip_ID#. What I was trying to do was count how many C's, A's, I's and N/A's there were for each field. For example, if there were three records within the specified dates - for the Chief Complaint how many C's, A's, I's and N/A's were there. I made text boxes that dcount the these values but they include the count for each record in the Trip table, while I just want the count for the records in the report that is based on the query.
 

Users who are viewing this thread

Back
Top Bottom