I need to do a tax query, and I have what I think is the text needed to make the query but I have no idea where I'm supposed to input the text.
Here is the text that I have, is this right?
SELECT date_part('month',s.session_start) AS SessionMonth, date_part('day',s.session_start) AS SessionDay, date_part('year', s.session_start) AS SessionYear, SUM(amount_won) AS AmountWon
FROM players AS p INNER JOIN session AS s ON s.player_id=p.player_id
WHERE p.screen_name='SCREENNAME' AND date_part('year', s.session_start) = YEAR
GROUP BY SessionMonth, SessionDay, SessionYear
ORDER BY SessionYear, SessionMonth, SessionDay;
Change SCREENNAME, YEAR to your main screenname in PT2 and the tax year in question.
