Posted: June 5, 2017 at 10:23 am
|
We’d like to have the counts for all approved registration per each event. So, we’re trying to come up with a query that pulls all event registrations records from the db and group them by the statuses. This is the query we use SELECT EVT_ID, STS_ID, REG_final_price ,REG_paid ,TKT_ID , count(TKT_ID) ,sum(REG_count) ,sum(REG_group_size) ,sum(REG_att_is_going) , sum(REG_deleted) Did we make a mistake somewhere? |
|
We tried counting all the related approved registrations for a particula revent below |
Hi there, The model system can be used to get an accurate count. Here’s a link to some documentation: An example:
|
|
|
Thanks for your guidance, we are able to pull the record counts as needed. There are, however, some discrepancies in the counts. On a related note, I’m not sure which records are considered “reserved” and aren’t the sum of all 4 reserved tickets supposed to equal the total listed at the top line of the captured screen (on the event date/time)? |
The numbers you cite alone aren’t enough to determine which of the two are “more accurate”, and not enough information for what would cause the discrepancy. I can tell you though that the interface grabs and displays the TKT_sold field directly from the _esp_ticket table. With regards to the reserved tickets, there usually are not records attached to those because they are registrations in progress. You can reserve count by going to the Event Espresso > Maintenance > Reset page. There’s a scheduled task that reduces those reserved ticket counts in the event of an abandoned registration. If the task scheduler (also known as the wp_cron() function) fails, then it’s a good time to use that reset button. |
|
|
Thanks for your reply. For investigation purpose, I exported the sales records file in excel and sort through it. It appears that the numbers pulled directly from the db (Total sold 328 and 77,186,17,48) are the correct one. |
The interface grabs and displays the TKT_sold field directly from the _esp_ticket database table. It does not actually count numbers of registrations or consider registration statuses. If you go into your database application and look at the esp_ticket table for the tickets in question, you’ll see that it matches what’s shown in the interface. |
|
|
I see. I’m curious to know what affects these numbers in the esp_ticket table, like how they got incremented each time. Knowing this might help finding out how the discrepancy occured. |
By cleaning up do you mean changing the values in the TKT_sold field so they match your approved registrations count? That’d be fine. |
|
|
Yes, but ideally I’d like to change it through the interface as I’d like to keep direct database changes to the minimum. |
|
Just spotted this, and thought I’d chip in that we previously encountered and reported the same issue last year. I ended up having to cobble together a script that updates the TKT_sold/DTT_sold fields in the database based on the actual sales numbers because it was causing all kinds of problems with sales and book-keeping. |
Thanks for chiming in. So in that other thread it was noted that you had some Pending Payment and Cancelled registrations there, which do not count as sales. |
|
|
Thanks Giant Dwarf for sharing your experience. That was very helpful. |
The support post ‘Attendee count (2)’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.