Okay, so I built a database that allows me to keep track of calls being made to potential customers. Basically, the user generates a call list, and after calling each customer, they update the Call Status field in one of my tables to either “Person Reached”, “Line Busy”, “Disconnected Number”, etc.
The problem I am having is that when I run the “Generate Call List” query (which I use to populate the Call List table), I am getting people who have already been reached. I have a condition that excludes anyone with a Call Status of “Person Reached”, but for some reason it’s not working. Here’s the SQL.
SELECT [Telephone Status].Patient_ID, Max([Telephone Status].Date_Called)
AS [Date Last Called]
FROM [Telephone Status]
WHERE ((([Telephone Status].Call_Status_Details)="Call Back Later") AND
(([Telephone Status].Call_Status)<>"Person Reached"))
GROUP BY [Telephone Status].Patient_ID;
I thought that by using the Max function with the Date_Called field, that I would be excluding individuals who have a “Person Reached” status from the most recent call (Max), but I am still getting people who have been reached.
How can I check for this condition (“Person Reached”) for the most recent Date_Called entry for each participant, and exclude them if the condition is True (Person was reached)?
The problem I am having is that when I run the "Generate Call List" query (which I use to populate the Call List table), I am getting people who have already been reached.
And how do you know that statement to be true? I think you need to examine the data in the [Telephone Status] table … the Date_Called, Call_Status_Details, and Call_Status fields for one of the Patient_ID which was erroneously included on the call list.
I have a condition that excludes anyone with a Call Status of "Person Reached", but for some reason it’s not working.
Not exactly …
… so you have two criteria which both must be True.
Some ways a "person reached" could be included in the call list query are:
other than "Person Reached", such as "Person R eached"; Person
Reachd"; etc.
Date_Called than the last Call_Status = "Person Reached", but
some other valid value for Call_Status.
The first is a data quality issue. You need to verify the data is consistently stored as you and your query expect.
I don’t know about the second possibility. It depends on your business rules and how they are implemented.
The last possibility, index corruption, appears to be rare in my experience, but I’ve heard it can happen. Compact & Repair could fix it. See Tony Towes’ Corrupt Microsoft Access MDBs FAQ for more detailed information.
Edit: You have a "Generate Call List" query which populates a Call List table. That is a situation where the Call List table could get out of sync with the latest updates to the [Telephone Status] table. It would be better to use the query itself for the call list rather than duplicating (possibly outdated) information in a separate table.