Hi,
Is there anyone who has managed to make a query in SQL2Excel to cover for both individual and Group registrations in DtRegister 2.7.x ?
I need to be able to get all data from Individual and Group registrations as well as the payment data and status.
I have looked at the other threads in this forum and managed to get the Individual
to work, without payment status:
SELECT M.user_id,Y.title AS Kurs,
MAX(CASE WHEN M.field_id = 12 THEN value END) AS Förnamn,
MAX(CASE WHEN M.field_id = 13 THEN value END) AS Efternamn,
MAX(CASE WHEN M.field_id = 20 THEN value END) AS Email,
MAX(CASE WHEN M.field_id = 23 THEN value END) AS Telefonnummer,
MAX(CASE WHEN M.field_id = 24 THEN value END) AS Telefonnummer2,
MAX(CASE WHEN M.field_id = 3 THEN value END) AS Medlemsnummer,
MAX(CASE WHEN M.field_id = 1 THEN value END) AS "Deltagare Namn",
MAX(CASE WHEN M.field_id = 2 THEN value END) AS "Deltagare Ålder"
FROM de5m_dtregister_user_field_values AS M
INNER JOIN de5m_dtregister_user AS Z ON Z.userid = M.user_id
INNER JOIN de5m_dtregister_group_event AS Y ON slabId = Z.eventId
WHERE Y.slabid > 135
GROUP BY M.user_id