Child pages
  • QBFunctions

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
Div
styledisplay:none
Div
iddescription
HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Row (tr)
Table Cell (td)
QBSelect
Table Cell (td)parent
Get Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable
idclass

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

Table Cell (td)
QBSelect
Table Cell (td)root
servoy sSummary12%30%58%height: 30px;3Property SummaryGet query builder parent table clause, this may be a query or a join clause. Table Row (tr)Get query builder parent. HTML Table

Colgroup Tag
Col
width80px
Col
Table Head (thead) Table Row (tr)styleservoy sSummary12%30%58%height: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)abs(value)
3Methods SummaryCreate abs(column) expression Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)bit_length(value)
Create bit_length(column) expression Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)cast(value, type)
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)ceil(arg)
Cast using type name. Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)coalesce(args)
Create ceil(column) expressionCreate year(date) expression Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)Create concat(arg1args, arg2)
Create concat Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)day(arg)
Create dayexpressionCreate day(date) expressionCreate divide(args, arg2) expressionCreate floor(column) expressionCreate hour(date) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
divide(arg1, arg2)
Create divide(args, arg2) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
floor(arg)
Create floor(column) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
hour(arg)
Create hour(date) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
len(value)
Create length(column) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
locate(string1, string2)
Create locate(str1, str2) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
locate(string1, string2, start)
Create locate(str1, str2, start) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
lower(value)
Create lower(column) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
minus(arg1, arg2)
Create minus(args, arg2) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
minute(arg)
Create minute(date) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
mod(dividend, divisor)
Create mod(dividend, divisor) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
month(arg)
Create month(date) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
multiply(arg1, arg2)
Create multiply(args, arg2) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
nullif(arg1)
Create nullif(arg1, arg2) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
plus(arg1, arg2)
Create plus(args, arg2) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
round(arg)
Create round(column) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
second(arg)
Create second(date) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
sqrt(value)
Create sqrt(column) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
substring(arg, pos)
Create substring(column, pos) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
substring(arg, pos, len)
Create substring(column, pos, len) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
trim(value)
Create trim(column) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
upper(value)
Create upper(column) expression
Table Row (tr)
Table Cell (td)
QBFunction
Table Cell (td)
year(arg)
Create year(date) expression
HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Details
Table Body (tbody)
idparent
Table Row (tr)
idname
Table Cell (td)

parent

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get query builder parent table clause, this may be a query or a join clause.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSelect
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/person>} */
	var query = databaseManager.createSelect('db:/example_data/person')
	query.where.add(query.joins.person_to_parent.joins.person_to_parent.columns.name.eq('john'))
	foundset.loadRecords(query)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idroot
Table Row (tr)
idname
Table Cell (td)

root

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get query builder parent.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSelect
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/order_details>} */
	var subquery = databaseManager.createSelect('db:/example_data/order_details')

 /** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
	query.where.add(query
		.or
			.add(query.columns.order_id.not.isin([1, 2, 3]))

			.add(query.exists(
					subquery.where.add(subquery.columns.orderid.eq(query.columns.order_id)).root
			))
		)

	foundset.loadRecords(query)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idabs-Object
Table Row (tr)
idname
Table Cell (td)

abs

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
abs
Span
(value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create abs(column) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mynum.abs.eq(query.functions.abs(myval)))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idbit_length-Object
Table Row (tr)
idname
Table Cell (td)

bit_length

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
bit_length
Span
(value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create bit_length(column) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.bit_length.eq(query.functions.bit_length('Sample')))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idcast-Object_String
Table Row (tr)
idname
Table Cell (td)

cast

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
cast
Span
(value, type)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Cast using type name.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value - object to cast
{String} type - type see QUERY_COLUMN_TYPES
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.result.add(query.functions.cast("22",QUERY_COLUMN_TYPES.TYPE_INTEGER)).add(query.columns.amt_discount.cast(QUERY_COLUMN_TYPES.TYPE_STRING));
application.output(databaseManager.getDataSetByQuery(query,1).getAsHTML())
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idceil-Object
Table Row (tr)
idname
Table Cell (td)

ceil

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
ceil
Span
(arg)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create ceil(column) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - number object
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mynumcol.ceil.eq(query.functions.ceil(myvar))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idcoalesce-ObjectArray
Table Row (tr)
idname
Table Cell (td)

coalesce

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
coalesce
Span
(args)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create year(date) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object...} args - arguments to coalesce
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mycol.coalesce('defval').eq(query.functions.coalesce(myvar, 'defval'))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idconcat-Object_Object
Table Row (tr)
idname
Table Cell (td)

concat

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
concat
Span
(arg1, arg2)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create concat(args, arg2) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg1
{Object} arg2
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/udm/contacts>} */
	var query = databaseManager.createSelect('db:/udm/contacts') //$NON-NLS-1$
	query.result.add(query.columns.name_first.concat(' ').concat(query.columns.name_last))
	var ds = databaseManager.getDataSetByQuery(query, -1)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idday-Object
Table Row (tr)
idname
Table Cell (td)

day

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
day
Span
(arg)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create day(date) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - date object
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mydatecol.day.eq(query.functions.day(mydatevar))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
iddivide-Object_Object
Table Row (tr)
idname
Table Cell (td)

divide

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
divide
Span
(arg1, arg2)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create divide(args, arg2) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg1
{Object} arg2
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mynumcol.divide(2).eq(query.functions.divide(myvar, 2))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idfloor-Object
Table Row (tr)
idname
Table Cell (td)

floor

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
floor
Span
(arg)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create floor(column) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - number object
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mynumcol.floor.eq(query.functions.floor(myvar))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idhour-Object
Table Row (tr)
idname
Table Cell (td)

hour

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
hour
Span
(arg)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create hour(date) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - date object
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mydatecol.hour.eq(query.functions.hour(mydatevar))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idlen-Object
Table Row (tr)
idname
Table Cell (td)

len

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
len
Span
(value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create length(column) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.len.eq(query.functions.len('Sample')))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idlocate-Object_Object
Table Row (tr)
idname
Table Cell (td)

locate

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
locate
Span
(string1, string2)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create locate(str1, str2) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} string1 - string to locate
{Object} string2 - string to search in
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.locate('amp').eq(query.functions.locate('Sample', 'amp')))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idlocate-Object_Object_Number
Table Row (tr)
idname
Table Cell (td)

locate

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
locate
Span
(string1, string2, start)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create locate(str1, str2, start) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} string1 - string to locate
{Object} string2 - string to search in
{Number} start - start pos
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.locate('amp', 1).eq(query.functions.locate('Sample', 'amp', 1)))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idlower-Object
Table Row (tr)
idname
Table Cell (td)

lower

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
lower
Span
(value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create lower(column) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.lower.eq(query.functions.lower('Sample')))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idminus-Object_Object
Table Row (tr)
idname
Table Cell (td)

minus

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
minus
Span
(arg1, arg2)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create minus(args, arg2) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg1
{Object} arg2
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mynumcol.minus(2).eq(query.functions.minus(myvar, 2))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idminute-Object
Table Row (tr)
idname
Table Cell (td)

minute

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
minute
Span
(arg)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create minute(date) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - date object
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mydatecol.minute.eq(query.functions.minute(mydatevar))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idmod-Object_Object
Table Row (tr)
idname
Table Cell (td)

mod

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
mod
Span
(dividend, divisor)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create mod(dividend, divisor) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} dividend
{Object} divisor
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mynumcol.mod(2).eq(query.functions.mod(myvar, 2))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idmonth-Object
Table Row (tr)
idname
Table Cell (td)

month

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
month
Span
(arg)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create month(date) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - date object
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mydatecol.month.eq(query.functions.month(mydatevar))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idmultiply-Object_Object
Table Row (tr)
idname
Table Cell (td)

multiply

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
multiply
Span
(arg1, arg2)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create multiply(args, arg2) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg1
{Object} arg2
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mynumcol.multiply(2).eq(query.functions.multiply(myvar, 2))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnullif-Object
Table Row (tr)
idname
Table Cell (td)

nullif

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
nullif
Span
(arg1)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create nullif(arg1, arg2) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg1
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.nullif('none').eq(query.functions.nullif('Sample', 'none')))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idplus-Object_Object
Table Row (tr)
idname
Table Cell (td)

plus

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
plus
Span
(arg1, arg2)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create plus(args, arg2) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg1
{Object} arg2
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mynumcol.plus(2).eq(query.functions.plus(myvar, 2))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idround-Object
Table Row (tr)
idname
Table Cell (td)

round

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
round
Span
(arg)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create round(column) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - number object
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mynumcol.round.eq(query.functions.round(myvar))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsecond-Object
Table Row (tr)
idname
Table Cell (td)

second

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
second
Span
(arg)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create second(date) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - date object
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mydatecol.second.eq(query.functions.second(mydatevar))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsqrt-Object
Table Row (tr)
idname
Table Cell (td)

sqrt

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
sqrt
Span
(value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create sqrt(column) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mynum.sqrt.eq(query.functions.sqrt(myval)))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsubstring-Object_Number
Table Row (tr)
idname
Table Cell (td)

substring

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
substring
Span
(arg, pos)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create substring(column, pos) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - column name
{Number} pos - position
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.substring(3).eq(query.functions.substring('Sample', 3)))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsubstring-Object_Number_Number
Table Row (tr)
idname
Table Cell (td)

substring

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
substring
Span
(arg, pos, len)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create substring(column, pos, len) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - column name
{Number} pos - position
{Number} len - length
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.substring(3, 2).eq(query.functions.substring('Sample', 3, 2)))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idtrim-Object
Table Row (tr)
idname
Table Cell (td)

trim

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
trim
Span
(value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create trim(column) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.trim.eq(query.functions.trim('Sample')))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idupper-Object
Table Row (tr)
idname
Table Cell (td)

upper

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
upper
Span
(value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create upper(column) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.shipname.upper.eq(query.functions.upper('Sample')))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idyear-Object
Table Row (tr)
idname
Table Cell (td)

year

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBFunction
Span
stylefont-weight: bold;
year
Span
(arg)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create year(date) expression
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arg - date object
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBFunction
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders') //$NON-NLS-1$
query.where.add(query.columns.mydatecol.year.eq(query.functions.year(mydatevar))
foundset.loadRecords(query);
Table Row (tr)
classlastDetailRow
Table Cell (td) Create length(column) expressionCreate locate(str1, str2) expressionCreate locate(str1, str2, start) expressionCreate lower(column) expressionCreate minus(args, arg2) expressionCreate minute(date) expressionCreate mod(dividend, divisor) expressionCreate month(date) expressionCreate multiply(args, arg2) expressionCreate nullif(arg1, arg2) expressionCreate plus(args, arg2) expressionCreate round(column) expressionCreate round(column) expressionCreate second(date) expressionCreate sqrt(column) expressionCreate substring(column, pos) expressionCreate substring(column, pos, len) expressionCreate trim(column) expressionCreate trim([leading | trailing | both] [characters] from column)Create upper(column) expressionCreate year(date) expression

propertyservoy sDetail2100%height:30px2Property Detailsparentname

parent

dessIndent
Get query builder parent table clause, this may be a query or a join clause.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowrootname

root

dessIndent
Get query builder parent.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods Detailsabsname

abs(value)

dessIndent
Create abs(column) expression
prs

Parameters

sIndentvalue ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowbit_lengthname

bit_length(value)

dessIndent
Create bit_length(column) expression
prs

Parameters

sIndentvalue ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
castname

cast(value, type)

dessIndent
Cast using type name.
prs

Parameters

sIndentvalueobject to casttypetype see QUERY_COLUMN_TYPES
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
ceilname

ceil(arg)

dessIndent
Create ceil(column) expression
prs

Parameters

sIndentargnumber object
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
coalescename

coalesce(args)

dessIndent
Create year(date) expression
prs

Parameters

sIndentargsarguments to coalesce
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
concatname

concat(arg1, arg2)

dessIndent
Create concat(args, arg2) expression
prs

Parameters

sIndentarg1 ;arg2 ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
customname

custom(name, args)

dessIndentprs

Parameters

sIndentnamecustom function nameargsfunction arguments
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
dayname

day(arg)

dessIndent
Create day(date) expression
prs

Parameters

sIndentargdate object
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
dividename

divide(arg1, arg2)

dessIndent
Create divide(args, arg2) expression
prs

Parameters

sIndentarg1 ;arg2 ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
floorname

floor(arg)

dessIndent
Create floor(column) expression
prs

Parameters

sIndentargnumber object
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
hourname

hour(arg)

dessIndent
Create hour(date) expression
prs

Parameters

sIndentargdate object
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
lenname

len(value)

dessIndent
Create length(column) expression
prs

Parameters

sIndentvalue ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
locatename

locate(string1, string2)

dessIndent
Create locate(str1, str2) expression
prs

Parameters

sIndentstring1string to locatestring2string to search in
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
locatename

locate(string1, string2, start)

dessIndent
Create locate(str1, str2, start) expression
prs

Parameters

sIndentstring1string to locatestring2string to search instartstart pos
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
lowername

lower(value)

dessIndent
Create lower(column) expression
prs

Parameters

sIndentvalue ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
minusname

minus(arg1, arg2)

dessIndent
Create minus(args, arg2) expression
prs

Parameters

sIndentarg1 ;arg2 ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
minutename

minute(arg)

dessIndent
Create minute(date) expression
prs

Parameters

sIndentargdate object
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
modname

mod(dividend, divisor)

dessIndent
Create mod(dividend, divisor) expression
prs

Parameters

sIndentdividend ;divisor ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
monthname

month(arg)

dessIndent
Create month(date) expression
prs

Parameters

sIndentargdate object
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
multiplyname

multiply(arg1, arg2)

dessIndent
Create multiply(args, arg2) expression
prs

Parameters

sIndentarg1 ;arg2 ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
nullifname

nullif(arg1)

dessIndent
Create nullif(arg1, arg2) expression
prs

Parameters

sIndentarg1 ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
plusname

plus(arg1, arg2)

dessIndent
Create plus(args, arg2) expression
prs

Parameters

sIndentarg1 ;arg2 ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
roundname

round(arg)

dessIndent
Create round(column) expression
prs

Parameters

sIndentargnumber object
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
roundname

round(arg, decimals)

dessIndent
Create round(column) expression
prs

Parameters

sIndentargnumber objectdecimalsThe number of decimal places to round number to, default 0
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
secondname

second(arg)

dessIndent
Create second(date) expression
prs

Parameters

sIndentargdate object
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
sqrtname

sqrt(value)

dessIndent
Create sqrt(column) expression
prs

Parameters

sIndentvalue ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
substringname

substring(arg, pos)

dessIndent
Create substring(column, pos) expression
prs

Parameters

sIndentargcolumn nameposposition
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
substringname

substring(arg, pos, len)

dessIndent
Create substring(column, pos, len) expression
prs

Parameters

sIndentargcolumn namepospositionlenlength
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
trimname

trim(value)

dessIndent
Create trim(column) expression
prs

Parameters

sIndentvalue ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
trimname

trim(leading_trailing_both, characters, fromKeyword, value)

dessIndent
Create trim([leading | trailing | both] [characters] from column)
prs

Parameters

sIndentleading_trailing_both'leading', 'trailing' or 'both'characterscharacters to removefromKeyword'from'valuevalue to trim
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
uppername

upper(value)

dessIndent
Create upper(column) expression
prs

Parameters

sIndentvalue ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
yearname

year(arg)

dessIndent
Create year(date) expression
prs

Parameters

sIndentargdate object
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow