Beast Mode

Beast Mode

Dynamic Date and Time

Member

Hello All,

I'm working currently on a report that would need data for just a specific date and time. Would you give any advice on how to create a beastmode script that will show the time between 6am on the previous day to 6am on the current day. Here is what my column looks like,

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In

Best Answers

  • Coach
    Answer ✓

    @LJ You can use a beast mode like this to filter to the times you want:

    1. case
    2. when DATE(`Alarm Received Store Time`) = CURRENT_DATE() - 1 and HOUR(`Alarm Received Store Time`) >= 6
    3. then 'Include'
    4. when DATE(`Alarm Received Store Time`) = CURRENT_DATE() and HOUR(`Alarm Received Store Time`) < 6
    5. then 'Include'
    6. else 'Exclude'
    7. end
  • Coach
    Answer ✓

    Alternatively you can simplify this with something like the following:

    1. case
    2. when DATE(`Alarm Received Store Time` - INTERVAL 6 HOUR) = CURRENT_DATE() - 1
    3. then 'Include'
    4. else 'Exclude'
    5. end
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • Coach
    Answer ✓

    @LJ You can use a beast mode like this to filter to the times you want:

    1. case
    2. when DATE(`Alarm Received Store Time`) = CURRENT_DATE() - 1 and HOUR(`Alarm Received Store Time`) >= 6
    3. then 'Include'
    4. when DATE(`Alarm Received Store Time`) = CURRENT_DATE() and HOUR(`Alarm Received Store Time`) < 6
    5. then 'Include'
    6. else 'Exclude'
    7. end
  • Member

    Thank You Michelle!

  • Coach
    Answer ✓

    Alternatively you can simplify this with something like the following:

    1. case
    2. when DATE(`Alarm Received Store Time` - INTERVAL 6 HOUR) = CURRENT_DATE() - 1
    3. then 'Include'
    4. else 'Exclude'
    5. end
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In