By ozadmin on Thursday, 27 October 2016
Replies 7
Likes 2
Views 1.3K
Votes 0
Hi Team,

I've got one of the users who wants to export all users who have attended a particular Event over the last couple of years. Is that possible? Please advise what syntax should I use in mySQL to extract the username and email address. The event has the same name every time they have it.

Thank you.

Best wishes,
Sathesh.
So its not the same event - is a sequence of 'unrelated' events with the same title?

That isn't trivial I'm afraid. Assuming they are not repeating events with separate signups per event

Something like this MAY

SELECT atdees.*, atdce.id, det.evdet_id FROM onjqe_jev_attendees as atdees
INNER JOIN onjqe_jev_attendance as atdce on atdees.at_id = atdce.id
INNER JOIN onjqe_jevents_vevent as evt on atdce.ev_id = evt.ev_id AND atdce.allrepeats = 1
INNER JOIN onjqe_jevents_vevdetail as det on evt.detail_id = det.evdet_id
WHERE det.summary = 'test'
·
Thursday, 27 October 2016 11:03
·
2 Likes
·
0 Votes
·
0 Comments
·
Yes, they are not the same event, but same title. Nope, they aren't repeating events

Will try and let you know. Thank you.
·
Wednesday, 02 November 2016 09:50
·
2 Likes
·
0 Votes
·
0 Comments
·
Thanks Geraint.

If I wanted to extract from a postcode range?
·
Thursday, 03 November 2016 07:58
·
2 Likes
·
0 Votes
·
0 Comments
·
Unfortunately the custom field data for each attendee is stored in a combined text field in JSON format so extracting entries based on a range of values of a specific field is going to be very hard (unless you are using MySQL 5.7+) - even then it would be slow and only work if you use the same session template for each of these events.
·
Thursday, 03 November 2016 10:04
·
2 Likes
·
0 Votes
·
0 Comments
·
oh..ok.. Thank you. We'll have to think of ways to do data extraction, I guess....
·
Thursday, 03 November 2016 23:00
·
2 Likes
·
0 Votes
·
0 Comments
·
SELECT atdees.*, atdce.id, det.evdet_id FROM onjqe_jev_attendees as atdees
INNER JOIN onjqe_jev_attendance as atdce on atdees.at_id = atdce.id
INNER JOIN onjqe_jevents_vevent as evt on atdce.ev_id = evt.ev_id AND atdce.allrepeats = 1
INNER JOIN onjqe_jevents_vevdetail as det on evt.detail_id = det.evdet_id
WHERE det.summary = 'test'


The thing with this code is that....it extracts from the entire system, all event creators. If I wanted it from just one particular event creator? Possible?
·
Sunday, 13 November 2016 00:00
·
2 Likes
·
0 Votes
·
0 Comments
·
where evt.created_by = 12
·
Monday, 14 November 2016 09:59
·
2 Likes
·
0 Votes
·
0 Comments
·
View Full Post