Hey Everyone
It's kinda complicated but maybe I'll get an answer here... Those who are looking for a challenge, keep reading!
I have got two databases. One has information about a series of courses, with for each course 3 available dates for users to signup for. If someone signs up for a course on a certain date, it is sent to the "signups" database, where the Course Title, Date and participants are stored (together with a uniquer order code to overview different participants).
So in my "signups" database, I can have multiple rows for one course on a specific date (from different people signing up). I need to get the sum of all these participants per course, and check if this is 20 (this means the course is full and signup should be closed).
Is there a way to check for duplicates in the "signups" database, and then count the number of participants for the combination "title/startDate"?
This is the "signups" database (for preview):
So I should find something that filters the database, if possible, like this:
wixData.query("signups")
.sameTitle
.sameDate
-> check if numParticipants = 20 => get these titles/dates to a filter function
I also need to filter the "courses" dataset to not display the courses on these dates. But I think I have figured this part out more or less, it's the query I can't fix.
Thanks to anyone who can help!