Home > WebEOC > Admin Guide > Board Building Tips > Show Only Records Within x Hours

Show Only Records Within x Hours

Table of contents
No headers

You can create a display filter for viewing only board record entries from the last x number of hours. The quickest way to do this is to create an expression that returns how old each record is (in hours) and then create a filter based on that expression.

For the expression, place the following code inside of the display view. Specifically, paste the code between the <eocrepeatallrecords> tags, just after the opening tag.

<if test="1=0">
<expression name="LessThanOneDay">
datediff(hh,dbo.convert2Local(entrydate,@TIMEZONE,@DAYLIGHT),dbo.convert2Local(getUTCDate(),@TIMEZONE,@DAYLIGHT))
</expression>
</if>

This code creates a count of how old an entry is in hours. The <if> tag around the code simply hides it from the view so it doesn't impact the display.

After this piece of code is placed into the display view, you are ready to create a filter. The name of the expression (LessThanOneDay in this example) shows up when you create the filter. When you add that criteria, WebEOC replaces the name with the contents of that expression. Using the example above, filter based on the LessThanOneDay field. Place LessThanOneDay at less than 24 to show any entries that have been updated within the past 24 hours.

After entering the code, create a view filter called "Eight Hours" with a parameter of diffhours <9.

Lastly, create a Filter button:

<filterbutton name="Eight Hours"><on>Show All Records</on><off>Show Records From
You must to post a comment.
Last modified

Tags

Classifications

This page has no classifications.