-1

I want to compose bigquery in app script with date1 & date2 variable (as mentioned below). What is the format to pass these 2 variable?

var date1="20180601"
var date2="20180606"

var sql = "select * from table_query([project-name:dataset],
'table_id <= "date2" and table_id >= "date1"');";
Rubén
  • 34,714
  • 9
  • 70
  • 166
Praveen
  • 31
  • 8
  • I am new to apps scripting..any help regarding this is very much appreciated.. – Praveen Jun 11 '18 at 17:53
  • I could do with following way: var sql = "select * from table_query([project-name:dataset], 'table_id <= \""+date2+"\" and table_id >= \""+date1+"\"');"; – Praveen Jun 12 '18 at 08:13
  • Can you post as an answer your own solution so other people can get help from it, please? – Rubén C. Jun 12 '18 at 08:31

1 Answers1

0

I could do it in the following way:

var date1="20180601"
var date2="20180606"
var sql = "select * from table_query([project-name:dataset], 'table_id <= \""+date2+"\" and table_id >= \""+date1+"\"');";
Rubén C.
  • 1,098
  • 6
  • 16
Praveen
  • 31
  • 8