sql语句问题

我在报表头部添加了一个根据时间查找的按钮。

但是现在sql无法进行查找。

select pro_project.name as proName,

pro_user.name as userName,

pro_project.stage_status as stageStatus,

FROM_UNIXTIME(pro_project_appraisal.time,"%Y-%m-%d") as appraisalDate,


pro_project_appraisal.* 


from pro_project_appraisal


join pro_project on pro_project_appraisal.pid=pro_project.id

join pro_user on pro_project_appraisal.uid=pro_user.id

where pro_project.status=1 

${if(len(timeDQ)==0,""," and pro_project_appraisal.time between '"+UNIX_TIMESTAMP(timeDQ)+"' and '"+(UNIX_TIMESTAMP(timeDQ)+86399)+"'")}

and pro_project_appraisal.status!=0


${if(len(userID)==0,"", " and pro_user.id='"+userID+"'")}



一直提示我

${if(len(timeDQ)==0,""," and pro_project_appraisal.time between '"+UNIX_TIMESTAMP(timeDQ)+"' and '"+(UNIX_TIMESTAMP(timeDQ)+86399)+"'")}

这一行语法错误。

麻烦哪位大佬给点意见或者建议


FineReport 郝波 发布于 2020-1-3 16:22 (编辑于 2020-1-3 16:23)
1min目标场景问卷 立即参与
回答问题
悬赏:4 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
豆豆小可爱Lv5中级互助
发布于2020-1-3 16:28

${if(len(timeDQ)==0,""," and pro_project_appraisal.time between UNIX_TIMESTAMP('"+timeDQ+"') and (UNIX_TIMESTAMP('"+timeDQ+"')+86399)")}


这样?

最佳回答
0
JackloveLv7高级互助
发布于2020-1-3 16:29


${if(len(timeDQ)==0,""," and UNIX_TIMESTAM(pro_project_appraisal.time) between '"+imeDQ+"' and '"+ timeDQ+86399+"'")}


  • 3关注人数
  • 319浏览人数
  • 最后回答于:2020-1-3 16:29
    请选择关闭问题的原因
    确定 取消
    返回顶部