WEEK(SQL("bidb","SELECT DISTINCT TO_CAHR('"+$日期+"','YYYYMMDD'),'iw) FROM DW.D_DATE",1,1))
直接week($日期)不行吗
week(format($日期,'yyyy-mm-dd'))
${日期} 是你设置的参数吗 那要写$日期
sql语句也要加上“”,比如
SQL("HSQL","SELECT * FROM CUSTOMER",2,2)