String to Date and Timestamp

In BigQuery you can use the following functions

Usage examples:

Date as inputFunction Call
2017/02/08TIMESTAMP(PARSE_DATE('%Y/%m/%d',date))
08/02/2017TIMESTAMP(PARSE_DATE('%d/%m/%Y',date))
08-02-2017TIMESTAMP(PARSE_DATE('%d-%m-%Y',date))
02082017TIMESTAMP(PARSE_DATE('%d%m%Y',date))

 

String to numeric

Number as inputFunction call
5CAST(number AS int64)
2.3CAST(number AS float64)

 

For BigQuery’s Legacy SQL you can alternatively use the function INTEGER(number) and FLOAT(number).

in SQL Playbook