Search code examples
google-sheetsgoogle-sheets-formula

Converting Specfic column into Date Format


I'm hoping you can help me with a formula that I'm using in Google Sheets. I'm encountering an error with the formula and I'm not sure how to resolve it. Here's the formula that I'm using:

=QUERY(IMPORTRANGE("Sheetlink","Emp. Leave Setup!B4:K"), "SELECT Col1, Col2, Col3, Col4, to_date(Col5), Col6, Col7, Col8, Col9, Col10 WHERE Col1 IS NOT NULL" ,0)

error is Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "(" "( "" at line 1, column 39. Was expecting one of: <EOF> "where" ... "group" ... "pivot" ... "order" ... "skipping" ... "limit" ... "offset" ... "label" ... "format" ... "options" ... "," ... "*" ... "+" ... "-" ... "/" ... "%" ... "*" ... "/" ... "%" ... "+" ... "-" ...


Solution

  • You can instead try this out:

    =QUERY(IMPORTRANGE("Sheetlink","Emp. Leave Setup!B4:K"), "SELECT Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Col10 WHERE Col1 IS NOT NULL format Col5 'mm-dd-yyy'")