1 today

Returns current date.

<today value='year|month|day'/>
Example

If the example were made on February 19, 2008, it would return 2008-02-19.

Copy
<today/>
 

2 current

Returns current date and time.

<current />
 

3 date

Extracts a date.

<date
    trunc='yes|y'
    format='format'
>
    <expresion /> *
</date>
Example
Copy
<select>
   <columns>
      <date format='dd-mm-yy'>14-04-08</date>
   </columns>
   <from table='test'/>
</select>
 

4 mdy

Convert three integer values into DATE format.

<mdy
    d='d'
    m='m'
    y='y'
>
    <d> *
        <day /> *
    </d>
    <m> *
        <month /> *
    </m>
    <y> *
        <year /> *
    </y>
</mdy>
Example
Copy
<mdy d='14' m='04' y='2008' />
 

5 year

Returns the year of a date.

<year>
    <value /> *
</year>
 

6 month

Returns the month of a date.

<month>
    <fecha /> *
</month>
 

7 weekday

Returns the day of the week represented by numbers from 0 to 6, where 0 equals Sunday, 1 Monday, etc...

<weekday>
    <value /> *
</weekday>
Example
Copy
<weekday>2005-12-02</weekday>
 

8 day

Returns the day of a date.

<day>
    <expresion /> *
</day>
Example
Copy
<day><today /></day>
 

9 lastday

Returns the last day of the month of a date.

<lastday>
    <expresion /> *
</lastday>
Example
Copy
<lastday><today /></lastday>
 

10 month

Extracts the month from a date.

<month>
    <fecha /> *
</month>
 

11 hour

Extract the hour from a date.

<hour>
    <fecha /> *
</hour>
Example
Copy
<hour><current /></hour>
 

12 minute

Extracts the minute of a date.

<minute>
    <fecha /> *
</minute>
Example
Copy
<minute><current /></minute>
 

13 second

Extracts the second of a date.

<second>
    <fecha /> *
</second>
Example
Copy
<second><current /></second>
 

14 days

Returns the number of days between two dates or datetimes. The start date and the end date can be indicated as attributes or arguments.

<days
    datefrom='datefrom'
    dateto='dateto'
>
    <datefrom> *
        <date /> *
    </datefrom>
    <dateto> *
        <date /> *
    </dateto>
</days>
Example
Copy
<days><datefrom>date_updated</datefrom><dateto>date_created</dateto></days>
Example
Copy
<days datefrom='2004-01-01' dateto='2005-12-01'/>
 

15 seconds

Returns the number of seconds between two dates or datetimes.

<seconds
    datefrom='datefrom'
    dateto='dateto'
/>
Example
Copy
<seconds><datefrom>date_updated</datefrom><dateto>date_created</dateto></seconds>
Example
Copy
<seconds datefrom='2004-01-01 23:32:03' dateto='2005-12-01 23:11:03'/>
 

16 eval-date

This tag allows you to perform arithmetic operations of addition and subtraction on dates.

<eval-date
    d='d'
    m='m'
    y='y'
>
    <val /> *
    <date unit='y|m|d|date'> *
        <value /> *
    </date>
</eval-date>
Example
Copy
USO
        ===
        1.- <eval-date d='-3'>$FECHA</eval-date>
        2.- <eval-date m='-4' y='2'>$FECHA</eval-date>
        3.- <eval-date d='-1' y='1'>$FECHA</eval-date>

              ids
              ==========================================
        1.-   $FECHA + (-3)
        2.-   $FECHA + (-4) UNITS MONTH + (2) UNITS YEAR
        3.-   $FECHA + (1) UNITS YEAR + (-1)

              DB2
              ==========================================
        1.-   $FECHA + (-3) DAYS
        2.-   $FECHA + (-4) MONTHS + (2) YEARS
        3.-   $FECHA + (1) YEARS + (-1) DAYS

              ORACLE
              ==========================================
        1.-   $FECHA + (-3)
        2.-   ADD_MONTH($FECHA,(-4) + (2*12))
        3.-   ADD_MONTH($FECHA,(1*12)) - 1
Example

Add a day and three months to a date.

Copy
<select>
<columns>
	<eval-date>
       <val unit='d'>1</val>
       <val unit='m'>3</val>
       <val unit='date'>fecha</val>
   </eval-date>
</columns>
<from table='gvenfach' />


</select>
 

17 eval-datetime

This tag allows you to perform arithmetic operations of addition and subtraction on expressions of datetimes type.

<eval-datetime
    y='y'
    m='m'
    d='d'
    h='h'
    min='min'
    s='s'
>
    <val /> *
    <date unit='y|m|d|h|min|s|datetime'> *
        <value /> *
    </date>
</eval-datetime>
Example

Add 1 day and, 3 months, 7 hours and 2 seconds to a datetime.

Copy
<select>
	<columns>
	    <eval-datetime>
	        <val unit='d'>1</val>
	        <val unit='m'>3</val>
	        <val unit='h'>7</val>
	        <val unit='s'>2</val>
	        <val unit='datetime'>date_created</val>
	    </eval-datetime>
	</columns>
	<from table='gvenfach' />
</select>
 

18 extend

It allows to increase or decrease the precision of a DATETIME variable.

<extend
    from='from'
    to='to'
>
    <variable /> *
</extend>
 

19 seconds-todsinterval

Given a number of seconds, it generates an interval DAY TO SECOND.

<seconds-todsinterval>
    <num_seconds /> *
</seconds-todsinterval>
Example

Get INTERVAL DAY TO SECOND for 80 seconds.

Copy
<seconds-todsinterval>80</seconds-todsinterval>