Difference between revisions of "Time-based Stored Queries"

From SDU
Jump to: navigation, search
m (See Also)
m
Line 1: Line 1:
 +
__NOTOC__
 +
[[Category:Customizations]]
 +
<div align='center'><font color="green">To make corrections or additions to this article, select the ''edit'' tab above.<br>
 +
To discuss or ask questions about this article, select the ''discussion'' tab above.</font></div>
 +
 +
== Details ==
 
Time-Base Queries are used in [[Stored_Queries|Stored Queries]] to make DateTime WHERE clauses possible. This is partly described in ''Unicenter Service Desk Modification'' Guide in the chapter ''4. Customization of Queries and Messages''.  
 
Time-Base Queries are used in [[Stored_Queries|Stored Queries]] to make DateTime WHERE clauses possible. This is partly described in ''Unicenter Service Desk Modification'' Guide in the chapter ''4. Customization of Queries and Messages''.  
  
Line 6: Line 12:
 
<source lang="javascript">EndAtTime (timespan-name)</source>
 
<source lang="javascript">EndAtTime (timespan-name)</source>
 
returns end of the timespan's period.
 
returns end of the timespan's period.
 +
  
 
== Timespans ==
 
== Timespans ==
Line 47: Line 54:
 
== See Also ==
 
== See Also ==
 
[[Stored Queries]]
 
[[Stored Queries]]
 
 
----
 
<div align='center'><font color="green">To make corrections or additions to this article, select the ''edit'' tab above.<br>
 
To discuss or ask questions about this article, select the ''discussion'' tab above.</font></div>
 

Revision as of 22:02, 25 July 2008

To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Details

Time-Base Queries are used in Stored Queries to make DateTime WHERE clauses possible. This is partly described in Unicenter Service Desk Modification Guide in the chapter 4. Customization of Queries and Messages.

You can use an exact date in the Time-Based Stored Queries or counted time using one of these 2 functions: <source lang="javascript">StartAtTime (timespan-name)</source> returns begin of the timespan's period. <source lang="javascript">EndAtTime (timespan-name)</source> returns end of the timespan's period.


Timespans

Timespans are simple string values (so must be enclosed in simple quotes leaded by backslash).

Here are possible timespan names (Let actual date and time be 26.6.2008 11:07:35):

Name StartAtTime EndAtTime Comment
AFTER_NOON
BEFORE_NOON
LAST_HOUR
LAST_MONTH
LAST_YEAR
PAST_HOUR 26.6.2008 10:07:35 26.6.2008 11:07:35 Current time -60 minutes
PAST_DAY 25.6.2008 11:07:35 26.6.2008 11:07:35 Current time -24 hours
PAST_WEEK 19.6.2008 11:07:35 26.6.2008 11:07:35 Current time -7 days
PAST_MONTH 26.5.2008 11:07:35 26.6.2008 11:07:35 Current time -30 days
PAST_YEAR 26.6.2007 11:07:35 26.6.2008 11:07:35 Current time -365 days
THIS_MONTH_LAST_YEAR
TODAY Same as LAST_DAY
TODO_TODAY 26.6.2008 24:00:00
YESTERDAY


See Also

Stored Queries