jeanna
10-14-2002, 08:35 AM
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?
Why can't you just Count the records on the Report?
jeanna
10-15-2002, 10:32 AM
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"
jeanna
10-16-2002, 08:16 AM
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
JeepsR4Mud
10-16-2002, 09:01 AM
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.
=Sum(Iif([ChiefComplaint]="C",1,0))
JeepsR4Mud
10-16-2002, 10:42 AM
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
JeepsR4Mud
10-16-2002, 11:14 AM
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
jeanna
10-16-2002, 11:28 AM
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.