How to define a time-of-day query range that is date-agnostic

How to define a time-of-day query range that is date-agnostic

book

Article ID: KB0074915

calendar_today

Updated On:

Products Versions
TIBCO Streaming -

Description

How can I define a time-of-day range for LiveView queries that is date-agnostic? For example, I'd like to add a condition where I want to select all rows where the value of field ArrivalTime is between 9am and 11am on ANY day.

Issue/Introduction

How to define a time-of-day query range that is date-agnostic

Resolution

To select rows between two hours of the day use the ArrivalTime timestamp field with the following predicate expression:
 
(get_hour(ArrivalTime) between 9 AND 11)


To select rows between two arbitrary times, 9:30am to 4pm, use the expression:
 
(get_hour(ArrivalTime) < 16) && ((get_hour(ArrivalTime) > 10) || (get_hour(ArrivalTime) == 9) && get_minute(ArrivalTime) >= 30)