0
Community Beginner
,
/t5/coldfusion-discussions/query-of-queries-testing-for-null-or-empty-dates/td-p/103746
May 18, 2006
May 18, 2006
Copy link to clipboard
Copied
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>
<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>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Community Beginner
,
May 23, 2006
May 23, 2006
I feel stupid, although i'd put a fiver on having tried that!
thanks
thanks
LEGEND
,
/t5/coldfusion-discussions/query-of-queries-testing-for-null-or-empty-dates/m-p/103747#M10136
May 18, 2006
May 18, 2006
Copy link to clipboard
Copied
Take away the check for an empty string.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
restlessmedia
AUTHOR
Community Beginner
,
/t5/coldfusion-discussions/query-of-queries-testing-for-null-or-empty-dates/m-p/103749#M10138
May 23, 2006
May 23, 2006
Copy link to clipboard
Copied
I feel stupid, although i'd put a fiver on having tried that!
thanks
thanks
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Beginner
,
LATEST
/t5/coldfusion-discussions/query-of-queries-testing-for-null-or-empty-dates/m-p/103750#M10139
May 23, 2006
May 23, 2006
Copy link to clipboard
Copied
I feel stupid, although i'd put a fiver on having tried that!
thanks
thanks
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/coldfusion-discussions/query-of-queries-testing-for-null-or-empty-dates/m-p/103748#M10137
May 18, 2006
May 18, 2006
Copy link to clipboard
Copied
Take away the check for an empty string.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

