radleydp
asked on
Query of Queries and cfqueryparam
Given this piece of code:
<cfquery name="GetNewHiresYear" dbtype="query">
SELECT HireDate
FROM GetOrderData
WHERE JobFamilyID = #Val( tFamID )#
AND #tColName# = '#tLbl#'
AND HireDate >= <cfqueryparam value="#DateFormat( CreateDate( DatePart( "yyyy", Now() ), 1, 1 ), "mm/dd/yyyy" )#" cfsqltype="CF_SQL_DATE">
</cfquery>
Why does the date comparison not work? Here is the debugging output:
SELECT HireDate
FROM GetOrderData
WHERE JobFamilyID = 40
AND EthnicOrigin = 'Native'
AND HireDate >= ?
Query Parameter Value(s) -
Parameter #1(CF_SQL_DATE) = {ts '2004-01-01 00:00:00'}
<cfquery name="GetNewHiresYear" dbtype="query">
SELECT HireDate
FROM GetOrderData
WHERE JobFamilyID = #Val( tFamID )#
AND #tColName# = '#tLbl#'
AND HireDate >= <cfqueryparam value="#DateFormat( CreateDate( DatePart( "yyyy", Now() ), 1, 1 ), "mm/dd/yyyy" )#" cfsqltype="CF_SQL_DATE">
</cfquery>
Why does the date comparison not work? Here is the debugging output:
SELECT HireDate
FROM GetOrderData
WHERE JobFamilyID = 40
AND EthnicOrigin = 'Native'
AND HireDate >= ?
Query Parameter Value(s) -
Parameter #1(CF_SQL_DATE) = {ts '2004-01-01 00:00:00'}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.