2 of 2 people found this helpful
see if this article helps. It mentions Postgres and Greenplum, though we found the issue to be true as well for SQL Server as well. And it suggests to use a dateadd function.
Thanks, but not sure how I incorporate that correctly within my current query.
depending on what timezone you are in, wrap the now() function with a dateadd with the appropriate value. It may take some quick trial and error to figure out what the proper value is (i.e. -4, -5, -6)
I'm just not able to get the query to work at all, thanks I've emailed my Tab account manager.
I would recommend running a performance recording to check out the underlying SQL. Run the custom SQL again and let us know what Tableau is generating so we can see the difference!
got it working!
select min(sd1.time), max(sd1.time)
from statistic_data sd1
join statistic_data sd2 on (sd1.session_id = sd2.session_id)
where sd1.statistic_id = 21
and sd2.statistic_id = 22
and sd1.numeric_value7= '0'
and sd1.time > now() - interval '4 hours' - INTERVAL '15 minutes'
and sd2.time > now() - interval '4 hours' - INTERVAL '15 minutes'