Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.1 » QAnywhere » QAnywhere 参考 » QAnywhere 传输和删除规则 » 规则语法

 

规则函数

可在传输规则中使用以下函数:

语法 说明
DATEADD( datepart, count, datetime )

返回通过将多个日期部分添加到 datetime 中而产生的日期时间。datepart 可以是 year、quarter、month、week、day、hour、minute 或 second 之一。例如,以下示例加了两个月,得到值 2006-07-02 00:00:00.0:

DATEADD( month, 2, '2006/05/02' )
DATEPART( datepart, date )

返回 datetime 值中一部分的值。datepart 可以是 year、quarter、month、week、day、dayofyear、weekday、hour、minute 或 second 之一。例如,以下示例获取以数字表示的五月份,得到值 5:

DATEPART( month, '2006/05/02' )
DATETIME( string ) 将字符串值转换为 datetime。字符串的格式必须为 'yyyy-mm-dd hh:nn:ss'。
LENGTH( string ) 返回字符串中的字符数。
SUBSTRING( string, start, length ) 返回字符串的子串。start 是要返回的子串的起始位置(以字符为单位)。length 是要返回的子串的长度(以字符为单位)。
 示例