• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Query of queries testing for null or empty dates

Community Beginner ,
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>

Views

736

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 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

Votes

Translate

Translate
LEGEND ,
May 18, 2006 May 18, 2006

Copy link to clipboard

Copied

Take away the check for an empty string.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 23, 2006 May 23, 2006

Copy link to clipboard

Copied

LATEST
I feel stupid, although i'd put a fiver on having tried that!

thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 18, 2006 May 18, 2006

Copy link to clipboard

Copied

Take away the check for an empty string.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation