Help with a DCount question (1 Viewer)

gojets1721

Registered User.
Local time
Today, 03:43
Joined
Jun 11, 2019
Messages
430
See the attached DB. I have really specific DCount question.

In the complaintfollowup field, users input dated notes and each note is separated by a line break. I'm trying to figure out a way to capture the number of records via DCount where the very last dated note in any given record is older than 30 days and the complaint status is 'open'. In my example, it would show one record.

Any suggestions?
 

Attachments

  • Example23.accdb
    560 KB · Views: 68

Josef P.

Well-known member
Local time
Today, 12:43
Joined
Feb 2, 2023
Messages
826
A lack of normalization makes itself felt at some point. Now the time has come. ;)
Imagine you had a separate record for each date value and the respective note in that record. How simple the required evaluation would be.
 

plog

Banishment Pending
Local time
Today, 05:43
Joined
May 11, 2011
Messages
11,646
Agree with Josef. You don't have a database, you have a spreadsheet with a form.

When you feel the need to jam a bunch of information into one field, it's time for a new table. You are doing this 2 ways in ComplaintFollowup. 1. Each line represents a new piece of data. 2. Each line itself contains 3 pieces of data (date, note & author). You need a ComplaintFollowup table. It would contain 5 fields and look like this:

tblFollowups
fu_ID, autonumber, primary key
ID_Complaint, number, foreign key back to tblComplaints.ID
fu_Date, date, date of followup
fu_Note, short text, note of complaint
fu_Author, short text, name of person writing follow up

You do that and what you want to find out becomes trivial.
 

gojets1721

Registered User.
Local time
Today, 03:43
Joined
Jun 11, 2019
Messages
430
Gotcha. I was dreading having to do this but you’re certainly right. I appreciate the help!
 

Josef P.

Well-known member
Local time
Today, 12:43
Joined
Feb 2, 2023
Messages
826
The alternative an evaluation with a calendar table and the hope that the date values were always entered in the same format is out of proportion to the clean solution by normalization.
 

gojets1721

Registered User.
Local time
Today, 03:43
Joined
Jun 11, 2019
Messages
430
The issue I've always had is there's thousands of complaints going back years. So it'd be quite a process to convert everything over to a separate table.
 

Josef P.

Well-known member
Local time
Today, 12:43
Joined
Feb 2, 2023
Messages
826
So it'd be quite a process to convert everything over to a separate table.
Why?
Work through the text via VBA and save it in the new table.
Maybe split the date blocks with RegEx.
 
Last edited:

Users who are viewing this thread

Top Bottom