This fucntions allows to generate a condition to be used in SQL sentences.
It is used to avoid the quotes from being inserted in the date argument value.
1 date.query
Usar con valores de fecha
This tab should be used exclusively with date values (DATE). For TIMESTAMP values, the argument is converted to DATE type.
<date.query>
<date /> !
</date.query>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Edate | Date |
Returns | |
---|---|
Type | Description |
String | A string is obtained with the condition to be used on a SQL query. |
Example
Pass a string to a date format.
Copy
<xsql-script name='date_query_sample1'> <body> <set name='cond'><string>fecha <= <date.query><date.today /></date.query></string></set> <foreach> <select prefix='s_' prepare='false'> <columns>docser</columns> <from table='gcompedh' /> <where> ${cond} </where> </select> <do> <println><s_docser/></println> </do> </foreach> </body> </xsql-script>