HONORENDTIME

Normally, a query keeps searching through archives until the desired number of samples has been located, or until it gets to the first or last archive. However, there are cases where you would want to specify a time limit as well. For example, you may want to output the returned data for a RawByNumber query in a trend screen, in which case there is no need to return data that would be off screen.

In cases where you want to specify a time limit, you can do this by specifying an end time in your RawByNumber query and including the HONORENDTIME query modifier. Since RawByNumber has direction (backwards or forwards), the end time must be older than the start time for a backwards direction or newer than the start time for a forwards direction.

Note: Use the HONORENDTIME modifier only with the RawByNumber sampling mode.
Example using HONORENDTIME with RawByNumber Sampling Mode

Import this data to Historian:

[Tags]
Tagname,DataType,HiEngineeringUnits,LoEngineeringUnits
TAG1,SingleInteger,60,0
[Data]
Tagname,TimeStamp,Value,DataQuality
TAG1,09/18/2015 14:00:00.000,00,Good
TAG1,09/18/2015 14:05:00.000,5,Good
TAG1,09/18/2015 14:10:00.000,10,Good
TAG1,09/18/2015 14:15:00.000,15,Good
TAG1,09/18/2015 14:20:00.000,20,Good
TAG1,09/18/2015 14:25:00.000,25,Good
TAG1,09/18/2015 14:30:00.000,30,Good
TAG1,09/18/2015 14:35:00.000,35,Good
TAG1,09/18/2015 14:40:00.000,40,Good
TAG1,09/18/2015 14:45:00.000,45,Good
TAG1,09/18/2015 14:50:00.000,50,Good
TAG1,09/18/2015 14:55:00.000,55,Good
TAG1,09/18/2015 15:00:00.000,60,Good
Without HONORENDTIME Query Modifier
set starttime='9/18/2015 14:00:00',endtime='9/18/2015 14:15:00'
select Timestamp,Value,Quality from ihrawdata where tagname like TAG1 and samplingmode=rawbynumber and 
direction=forwardand numberofsamples=6

The output is as follows:

Time StampValueQuality
9/18/2015 14:00:000Good NonSpecific
9/18/2015 14:05:005Good NonSpecific
9/18/2015 14:10:0010Good NonSpecific
9/18/2015 14:15:015Good NonSpecific
9/18/2015 14:20:0020Good NonSpecific
9/18/2015 14:25:0025Good NonSpecific

In the above query, the endtime specified is ignored and 6 values are returned.

With HONORENDTIME Query Modifier
set starttime='9/18/2015 14:00:00',endtime='9/18/2015 14:15:00'
select TagName,Timestamp,Value,Quality from ihrawdata where tagname like TAG1 and samplingmode=rawbynumber and 
direction=forward and numberofsamples=6 and criteriastring=#honorendtime

The output is as follows:

Time StampValueQuality
9/18/2015 14:00:000Good NonSpecific
9/18/2015 14:05:005Good NonSpecific
9/18/2015 14:10:0010Good NonSpecific
9/18/2015 14:15:015Good NonSpecific

In the above query, the endtime specified is used and only 4 values are returned.

Anticipated Usage

Use the HONORENDTIME modifier when you would want to specify a time limit to a query. For example, you may want to output the returned data for a RawByNumber query in a trend screen, in which case there is no need to return data that would be offscreen.