姬長信(Redy)

mysql – 参数化查询的ColdFusion


我有一个查询,我运行以填充我试图参数化的CFChart:

    SELECT *
    FROM   closed_tickets
    WHERE  MONTH(closed_date) = #month# 
    AND    YEAR(closed_date) = #dateFormat(theMonth,"yyyy")# 
    AND    technician_id = #techID#
 

这是我尝试过的:


          
    SELECT *
    FROM   closed_tickets
    WHERE  MONTH(closed_date) =  
    AND    YEAR(closed_date) = #dateFormat(theMonth,"yyyy")#" cfsqltype="CF_SQL_TIMESTAMP"> 
    AND    technician_id = 

当我将查询更改为此时,它会以某种方式破坏我的CFChart.我没有在屏幕上看到任何CFErrors,但我的CFChart是空白的.

我在我的查询中将其缩小到与此相关:

#dateFormat(theMonth,"yyyy")#" cfsqltype="CF_SQL_TIMESTAMP"

当我删除查询的这个参数化部分,然后放

#dateFormat(theMonth,"yyyy")#

有用.

任何人都可以对此有所了解吗?