Sort out hands from last 5 hours

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

Sort out hands from last 5 hours

Postby Lakestone » Thu Mar 08, 2012 3:33 pm

Is it possible to add a filter to 'Report Stats' to get all hands to display from the last 5 hours of play inside 'Holdem Tournament Hand' in 'Reports' ?
Lakestone
 
Posts: 86
Joined: Tue Jan 31, 2012 2:29 pm

Re: Sort out hands from last 5 hours

Postby kraada » Thu Mar 08, 2012 6:08 pm

Yes use this filter:

tourney_holdem_hand_player_statistics.date_played > now() - interval '5 hours'
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Sort out hands from last 5 hours

Postby Lakestone » Fri Mar 09, 2012 12:55 pm

kraada wrote:Yes use this filter:

tourney_holdem_hand_player_statistics.date_played > now() - interval '5 hours'


This did not do it for me, I got zero hands, even though I have no other filter and have played about 1000 hands the last hour :?:
Lakestone
 
Posts: 86
Joined: Tue Jan 31, 2012 2:29 pm

Re: Sort out hands from last 5 hours

Postby kraada » Fri Mar 09, 2012 2:43 pm

Do you use the My Day Starts At setting value?
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Sort out hands from last 5 hours

Postby Lakestone » Fri Mar 09, 2012 3:53 pm

kraada wrote:Do you use the My Day Starts At setting value?


12 Midnight
Lakestone
 
Posts: 86
Joined: Tue Jan 31, 2012 2:29 pm

Re: Sort out hands from last 5 hours

Postby kraada » Fri Mar 09, 2012 5:54 pm

That's odd that should have worked, but try this and see if this works better for you:

tourney_holdem_hand_player_statistics.id_hand in (SELECT thhps.id_hand from tourney_holdem_hand_player_statistics thhps where thhps.date_played > now() - interval '5 hours')
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Sort out hands from last 5 hours

Postby Lakestone » Sat Mar 10, 2012 3:28 pm

kraada wrote:tourney_holdem_hand_player_statistics.id_hand in (SELECT thhps.id_hand from tourney_holdem_hand_player_statistics thhps where thhps.date_played > now() - interval '5 hours')


Better, but 10h works more like h5 and 5h more like 1h ? :(
Lakestone
 
Posts: 86
Joined: Tue Jan 31, 2012 2:29 pm

Re: Sort out hands from last 5 hours

Postby WhiteRider » Sat Mar 10, 2012 3:39 pm

It could be affected by your timezone - times are stored in the database as GMT/UTC times, so if you're comparing the unadjusted times you may need to include an offset. Once you figure out what that offset is it should remain consistent, so you might always need to add 4 hours, or whatever, to the value you actually want.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Sort out hands from last 5 hours

Postby Lakestone » Sun Mar 11, 2012 8:21 am

WhiteRider wrote:It could be affected by your timezone - times are stored in the database as GMT/UTC times, so if you're comparing the unadjusted times you may need to include an offset. Once you figure out what that offset is it should remain consistent, so you might always need to add 4 hours, or whatever, to the value you actually want.


Oh I see, I guess its working as intended then - thanks man ;)
Lakestone
 
Posts: 86
Joined: Tue Jan 31, 2012 2:29 pm


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

Who is online

Users browsing this forum: No registered users and 0 guests