View Single Post
  #8  
Old 11-08-2005, 11:45 AM
Dazarath Dazarath is offline
Senior Member
 
Join Date: Nov 2004
Posts: 185
Default Re: How do I verify my rakeback w/ pokertracker?

Here's an SQL query that I *think* should calculate rakeback (Party style):

select sum(rake / (select count(played_hand) from game_players gp where played_hand = 'Y' and gp.game_id = g.game_id)) as MGR,
sum(rake / (select count(played_hand) from game_players gp where played_hand = 'Y' and gp.game_id = g.game_id)) * <font color="red">RAKEBACK</font> as rakeback
from game g
where (select played_hand from game_players gp where player_id = (select player_id from players where screen_name = '<font color="red">SCREENNAME</font>') and gp.game_id = g.game_id) = 'Y'
and date_part('month', g.date_played) = <font color="red">MONTH</font>

Few things:
- Change <font color="red">RAKEBACK</font> to a numerical value representing the rakeback percent you get. ie. if you get 25%, change it to 0.25
- Change <font color="red">SCREENNAME</font> to your screenname. ie. if your screenname is DERB, then change it to DERB (leave the quotes there)
- Change <font color="red">MONTH</font> to a number from 1-12 representing the month you want to look at. ie. if you want to see your rakeback for this month so far (november) change it to 11

I was testing it out, and it didn't seem to match up exactly with what my affiliate posted for previous months. I'm not sure the query will work if you have aliases. Could someone who knows SQL take a look at it and tell me what's wrong?

Oh, this is for Postgres, I don't know anything about Access.
Reply With Quote