System

<< Click to Display Table of Contents >>

Navigation:  Data Module > Import & export > Data mappings > SQL Basics > Functions >

System

Name

Example

ISNULL

SELECT AVG(ISNULL(price, 10.00)) FROM titles

DATEADD

SELECT millisecond(DATEADD('ms',1,'6/30/2005 1:47:56.998 AM'))

Refer to the SQL Server DATEADD function for supported date parts.

DATEDIFF

SELECT DATEDIFF('ms','6/30/2005 1:46:55.998 AM','6/30/2005 1:47:56.998 AM')

DATEPART

SELECT DATEPART('year','6/30/2005 1:47:56.998 AM')

NEWID

SELECT newid()

ISDATE

SELECT IsDate('7/16/2005 6:28:55.999 PM'), isdate('test'), isdate(1), isdate(NULL)

ISNUMERIC

SELECT isnumeric('test'), isnumeric(1.1), isnumeric('$1.1'),isdate(NULL)

DATALENGTH

select DATALENGTH(description) from [item_info]

RAND

SELECT rand(), rand(), rand(cast(getdate() as int)), rand(NULL)

LEAST

select least(Q1, Q2, Q3, Q4) from annual_income

GREATEST

select greatest(Q1, Q2, Q3, Q4) from annual_income

REPLICATE

select replication('0', 5)