hello,
I am not sure it would work because just like myDate: thisDate and thatDate are column name of myTable. They are not input data.
The code below gives me an error
<cfquery name="myQuery" datasource="myDataSource">
SELECT *
FROM Table
WHERE sysDate BETWEEN <cfqueryparam value ="thisDate" cfsqltype="CF_SQL_DATE"> AND
<cfqueryparam value ="thatDate" cfsqltype="CF_SQL_DATE">
<cfquery>
OR
<cfquery name="myQuery" datasource="myDataSource">
SELECT *
FROM Table
WHERE sysDate BETWEEN <cfqueryparam value ="#thisDate#" cfsqltype="CF_SQL_DATE"> AND
<cfqueryparam value ="#thatDate#" cfsqltype="CF_SQL_DATE">
<cfquery>
By @pham_mn
cfqueryparam is for input data. If thisDate and thatDate are column names representing date values, and you trust the values, then you require
<cfquery name="myQuery" datasource="myDataSource">
SELECT *
FROM Table
WHERE sysDate BETWEEN thisDate AND thatDate
<cfquery>