7 Replies Latest reply on Nov 11, 2016 11:56 AM by Chris Tighe

    Previous Hour at Midnight

    Chris Tighe



      I currently need help pulling the last hour.


      I have


      IF DATEPART('hour',NOW())-1=[Hour] THEN [Value Net Revenue] END


      Which works great for pulling the previous hour unless it's midnight. When it's midnight, this solution doesn't work any longer and everything is blank. This is due to the NOW()) - 1 actually = -1 instead of 23.


      I've tried numerous things but if the current hour is midnight, I need it to look at hour (23) and pull the value net revenue for that hour. (Ensuring it is still looking at the correct Date)


      I'm not able to attach a workbook.


      Any help would be greatly appreciated!