Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Filter by Current day

Hi,

 

I want to filter out rows and only include the current day in my direct query. i have used 

 

 

 

 

 

 

 

 

 

 

 

 

 

This works fine for today but when i publish the report and look at in the web viewer it stops at midnight. So the next day no matter how much i refresh it wont move to "today" and stays on yesterday. I have to re-publish the report and this fixes it.

 

any ideas to keep it active for the current day? I also have this issue with current hour, as soon as it moves on the refresh stops.

 

any help would be great.

4 Replies

  • jthomson's avatar
    jthomson
    Solution Sage

    Look at what's actually happening in the advanced editor - I'd guess it's not actually writing the code for today, instead writing the code for 14/8/2018. Have a look and maybe replace it with DateTime.Date(DateTime.LocalNow()) if that's the case

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the help,

       

      I changed it to 15 minutes to help fault find and here is the code below. It works when I press refresh in the desktop but when I publish it doesn;t update the rolling 15 minute window. It seems to only keep the original window until i refresh and re-publish the dataset.

       

      any idea why this is the case or how to get around it? 

       

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      I'm finally back in the office to check this.

       

      This is a Direct Query so i don't have the option for the scheduled refresh.

       

      Any other ideas?