Date and Time Shortcuts

The following table outlines the date and time shortcuts that you can use to define the start time, end time, and timestamp values in a query.

Table 1. Date and Time Shortcuts
Time SegmentMeaning
nowNow (the time and date that you execute the query)
todayToday at midnight
yesterdayYesterday at midnight
monThe previous Monday at midnight
tuesThe previous Tuesday at midnight
wedThe previous Wednesday at midnight
thursThe previous Thursday at midnight
friThe previous Friday at midnight
satThe previous Saturday at midnight
sunThe previous Sunday at midnight
boyFirst day of year at midnight
eoyLast day of year at midnight
bomFirst day of month at midnight
eomLast day of month at midnight

Example 1: Set the Start Time to the First Day of the Month

SET starttime=bom

Example 2: Retrieve Messages Dated Today

SELECT * FROM ihmessages WHERE timestamp>=today