FAQ 032: I use MS SQL server. How can I use calculated Timestamps for start time and end time as a condition in SQC or in SQL tables?

For MS SQL server you can use the following conversion function CONVERT:

Syntax for CONVERT:
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )

Where:

  • expression – is any valid expression.

  • data_type – is the target system-supplied data type. This includes xml, bigint and sql_variant. Alias data types cannot be used. For more information about available data types, see Data Types (Transact-SQL).

  • style – is the style of the date format used to convert datetime or smalldatetime data to character data (nchar, nvarchar, char, varchar, nchar, or nvarchar data types), or to convert character data of the known date or time formats to datetime or smalldatetime data; or the string format used to convert float, real, money, or smallmoney data to character data (nchar, nvarchar, char, varchar, nchar, or nvarchar data types). When style is NULL, the result returned is also NULL.