String to Date and Timestamp

The CONVERT function converts an expression of one data type to another. Its syntax is :

CONVERT(target_data_type(length),expression,style)

Date as inputFunction call
02/08/17CONVERT(varchar,date,101)
17.02.08CONVERT(varchar,date,102)
08/02/17CONVERT(varchar,date,103)
08.02.17CONVERT(varchar,date,104)
08-02-17CONVERT(varchar,date,105)
08 02 17CONVERT(varchar,date,106)
February 08, 17CONVERT(varchar,date,107)
10:59:00CONVERT(varchar,date,108)
February 08 2017, 10:59:00AM(or PM)CONVERT(varchar,date,109)
02-08-2017CONVERT(varchar,date,110)
17/02/08CONVERT(varchar,date,111)
170208CONVERT(varchar,date,12)
20170208CONVERT(varchar,date,112)
08 02 2017 10:59:00 (in 24h)CONVERT(varchar,date,113)

 

String to Numeric

For conversion from string to numeric data you can use the cast function with the following syntax:

Number as inputFunction call
5CAST(number AS int)
2.3CAST(number AS float)

 

in SQL Playbook