ColdFusion Parameterizing a Query

后端 未结 3 625
生来不讨喜
生来不讨喜 2020-11-29 13:56

I have a query that I run to populate a CFChart that I am trying to parametrize:


    SELECT *
             


        
3条回答
  •  日久生厌
    2020-11-29 14:52

    I suggest you change your approach. Start with

    StartDate = CreateDate(TheYearYouWant, TheMonthYouWant, 1);
    EndDate = DateAdd("m", 1, StartDate);
    

    and the date filtering of your query becomes:

    where closed_date >= 
    and closed_date < 
    

    This will execute faster than using functions in your where clause.

提交回复
热议问题