Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting of IIF expression in query. 1

Status
Not open for further replies.

houstonbill

Technical User
Nov 6, 2006
92
Have a query that makes up a report. I am forcing myself to try and use IIF expressions so I can learn them. 2hours into it and after looking at multiple examples, I am looking for a bit of assistance and any help in formatting would be appreciated.

I am trying to display the value of all my fields (Date, CSR,Team,Reason,TOC,TOW,LOB,Resource,PCS,Comments)in my subsequent report. If the comments field is Null, I want all fields to populate the report except the Comments field.






 
And if the comments field is NOT NULL, what do you want to happen?

Queries are constrained to return tables with a fixed number of columns and a variable number of rows.

I infer that you are trying to get the query to return all fields except "Comments" when the Comments field is NULL on a particular row and to return all fields PLUS the Comments field when it is not. That implies a different number of fields on different rows and that's not allowed in SQL.
 
Your account of what I am trying to do is correct. I guess then I will have to leave as is. As a last entry on the stepped report, I thought maybe I could elimate some space that would be blank. Thanks for letting me know what I am trying to do will not work with SQL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top