Home > Back-end >  How do I add number of days from original dates in new column
How do I add number of days from original dates in new column

Time:01-11

Hopefully a quick one on BigQuery

I've tried intervals and days but can't quite seem to get what I want. For date row on the example table below I want and adjacent row in a new column that just adds 42 days to the original date and time (time is always 00:00:00 if that helps).

Desired output below:

original_datetime date_time_plus_42_days
2016-04-01T00:00:00 plus 42 days to left column
2016-05-04T00:00:00 plus 42 days to left column
2018-05-17T00:00:00 plus 42 days to left column
2019-09-01T00:00:00 plus 42 days to left column
2016-04-01T00:00:00 plus 42 days to left column

CodePudding user response:

The function you are looking for is called: DATETIME_ADD. It is documented enter image description here

  •  Tags:  
  • Related