0

The below statement is in SQL code. How do I write it in BigQuery?

select to_number(to_char(sysdate,'yyyy')) from dual

1
  • what do you mean by "big query" ? Provide corresponding links to the tools you are referring. Commented Jul 25, 2020 at 7:05

2 Answers 2

2

As described in https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions

Try something like:

SELECT EXTRACT(YEAR FROM CURRENT_DATE()) as the_date;
Sign up to request clarification or add additional context in comments.

Comments

0

You can try this:

SELECT FORMAT_DATETIME("%Y", CURRENT_DATE()) as current_year;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.