I'm having problems with this query (within a function). The
last condition in the where clause needs to check for an empty or
null date and then check against the current date (which is fine),
im aware that the syntax is wrong but wondered if someone could
correct it for me to get it working.
<cfquery name="filterQuery" dbtype="query"
maxrows="#arguments.top#">
select * from getAllSaved
where
workFlowStatusId = <cfqueryparam
cfsqltype="CF_SQL_INTEGER"
value="#application.const.WORKFLOW_LIVE#" />
and
dateArchive > <cfqueryparam cfsqltype="CF_SQL_DATE"
value="#now()#" />
and
dateLive <= <cfqueryparam cfsqltype="CF_SQL_DATE"
value="#now()#" />
and
(dateExpiry is null or dateExpiry = '') or dateExpiry >
<cfqueryparam cfsqltype="CF_SQL_DATE" value="#now()#" />
</cfquery>