Home > other >  WHERE _Table_Suffix BETWEEN CAST(format_date('%Y%m%d',current_date() - 13) AS STRING) AND
WHERE _Table_Suffix BETWEEN CAST(format_date('%Y%m%d',current_date() - 13) AS STRING) AND

Time:02-17

In query how shud we change the -13 days value to start date from 01-01-2022 in sql ?

WHERE _Table_Suffix BETWEEN CAST(format_date('%Y%m%d',current_date() - 13) AS STRING) AND CAST(format_date('%Y%m%d',current_date()) AS STRING)

CodePudding user response:

Try try replacing current_date() - 13 with DATE '2022-01-01'. This will read as from 1-jan-2022 to current date; is this what you want?

  • Related