Donna French wrote:
> Should this code work if I only pass the StartDate, EndDate and Param1Val?

No.


> <cfparam name="Param2Val" default="null">
> <cfparam name="Param3Val" default="null">
> 
> <cfinclude template="Connections/wdv.cfm">
> <cfquery name="rsReport" datasource=#MM_wdv_DSN#
> username=#MM_wdv_USERNAME# password=#MM_wdv_PASSWORD#>
> SELECT COUNT(Clients.Client_ID) as ClientCount
> FROM Clients 
> WHERE 
>       Client_IntakeDate >= <cfqueryparam value="#Form.StartDate#"
> cfsqltype="cf_sql_date">
>       AND
>       Client_IntakeDate <= <cfqueryparam value="#Form.EndDate#"
> cfsqltype="cf_sql_date">
>       AND
>       #Form.Param1# = <cfqueryparam value="#Form.Param1Val#" null="no">

This will throw an error because form.param1 is undefined.

>       AND
>       #Form.Param2# = <cfqueryparam value="#Form.Param2Val#" null="yes">

Here both form.param2 and form.param2val are undefined. Remember 
that your cfparam is for param2val, not form.param2val. (CF might 
skip past the param2val issue though since it is essentially a 
constant and the compiler might recognize it as such.)

>       AND
>       #Form.Param3# = <cfqueryparam value="#Form.Param3Val#" null="yes">;

Same issue.

> </cfquery>

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.houseoffusion.com/banners/view.cfm?bannerid=11

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183225
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to