Skip to main content
June 27, 2008
Question

Using cfif statement in CF Report Builder

  • June 27, 2008
  • 1 reply
  • 938 views
How can I use if statements when building a query within CF Report Builder?

Existing Code that doesn't work in the Report Builder Query:
Select *
FROM Issue_PrioritizationReport
WHERE 0=0
<cfif IsDefined("param.Team")> AND IssueTeamID IN (#Param.Team#)</cfif>
<cfif IsDefined("Param.TypeID")> AND IssueTypeID IN (#Param.TypeID#)</cfif>
<cfif Param.Ranked EQ 1> AND Rank <> ''</cfif>
ORDER BY <cfif Param.Sort EQ 'Default'>Rank, IssueID <cfelse> SortDueDate</cfif>
This topic has been closed for replies.

1 reply

Inspiring
June 30, 2008
Hi,

In the SQL query panel (under Query builder wizard) (in where all the fields of your table gets listed) set the condition attribute of your "IssueTeamID" as "where" and put the "criteria" as "param.team" follow the same for "type" field too..

Test the query and confirm the required resultset is getting fetched.