WHERE _Table_Suffix BETWEEN CAST(format_date('%Y%m%d',current_date() - 13) AS STRING) AND CAST(format_date('%Y% m%d',current_date()) 作为字符串)

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)

询问我们如何将 -13 天的值更改为 sql 中的 01-01-2022 开始日期?

WHERE _Table_Suffix BETWEEN CAST(format_date('%Y%m%d',current_date() - 13) 作为字符串) AND CAST(format_date('%Y%m%d',current_date()) 作为字符串)

尝试用 DATE '2022-01-01' 替换 current_date() - 13。这将读作 from 1-jan-2022 to current date;这是你想要的吗?