Report amount won/lost per hour of day

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Report amount won/lost per hour of day

Postby PietM » Tue Jul 08, 2008 11:23 am

I'm trying to create a report to list my win/loss per hour of the day. I created a column in the Holdem Cash Hand section with the name 'hour' and expression date_part('hour',date_played). I checked the group-by box.

I added a stat to show the new column and created a new report with this new stat, plus amount_won. Then I get the following error:
Unable to execute query: SELECT (date_part('hour',(holdem_hand_player_statistics.date_played))), (holdem_hand_player_statistics.date_played), (holdem_hand_player_statistics.amt_won) FROM holdem_hand_summary, holdem_hand_player_statistics WHERE (holdem_hand_player_statistics.id_player = 37) AND (holdem_hand_summary.id_hand = holdem_hand_player_statistics.id_hand) AND (((holdem_hand_summary.id_site in (300) )AND (holdem_hand_player_statistics.id_limit in (2) ))AND ((holdem_hand_player_statistics.date_played >= '2008/06/30 22:00'))) GROUP BY (date_part('hour',(holdem_hand_player_statistics.date_played))) ; Reason: Fatal Error (ERROR: column "holdem_hand_player_statistics.date_played" must appear in the GROUP BY clause or be used in an aggregate function )

Why does PT3 select (holdem_hand_player_statistics.date_played)?? And how do I get a SUM on the amount_won column?

Or is there a better way to create this report?
PietM
 
Posts: 15
Joined: Fri Jan 25, 2008 5:19 am

Re: Report amount won/lost per hour of day

Postby PietM » Wed Jul 30, 2008 4:01 pm

No love for this question?
PietM
 
Posts: 15
Joined: Fri Jan 25, 2008 5:19 am

Re: Report amount won/lost per hour of day

Postby WhiteRider » Wed Jul 30, 2008 4:26 pm

I assume it's selecting holdem_hand_player_statistics.date_played because that's what is used to build the date_played column?
I'm afraid I don't know how to correct this, but you could start by removing the 'group by' and see if you get sensible values for your Hour Stat when you create a report to list some hands.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests