That's the whole point, Joe... I have the following code above it <cfif not qryCustomer.allareas> <cfquery name="qryAreas" datasource="#request.dsn#"> somequery </cfquery> </cfif>
So therefore, qryAreas.name will only be defined if qryCustomer.allareas is false. I mean I have commented out the cfif above, so that the query runs in either case, but I'd still like to know how to get the iif to work the way I want it to. Russ P.S. Yes, sorry about missing the single quotes in the middle. I have the following code now, but still has the same problem if the qryAreas is not defined and qryCustomer.allareas is true: #iif(qryCustomer.allareas," 'All Areas' "," '#ValueList(qryAreas.name,', ')#' ")# -----Original Message----- From: Joe Eugene [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 08, 2002 6:32 PM To: CF-Talk Subject: Re: iif usage Carefully note the usage of single and double quotes.. there are there for a reason! and make sure... u have the query.columnName.. u are pointing..to #IIF(qryCustomer.allareas," 'All Areas' "," '#ValueList(qryAreas.name,',')#' ")# Joe ----- Original Message ----- From: "Ruslan Sivak" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Sunday, September 08, 2002 6:03 PM Subject: RE: iif usage > #iif(qryCustomer.allareas,"All Areas"," '#ValueList(qryAreas.name,', > ')#' ")# > > Doesn't work either. > > Parameter 1 of function ValueList which is now "qryAreas.name" must be > pointing to a valid query name > > Russ > -----Original Message----- > From: Joe Eugene [mailto:[EMAIL PROTECTED]] > Sent: Sunday, September 08, 2002 5:49 PM > To: CF-Talk > Subject: Re: iif usage > > qryCustomer.allareas should be a "0" or any number other than "0" which > is > True > > your statment should look like below.. u dont need "DE" > > #IIF(qryCustomer.allareas," 'All Areas' "," > '#ValueList(qryAreas.name,',')#' > ")# > > Which means if qryCustomer.allareas !=0 ...display "ALL Areas" > else > Display qryAreas.name list.. > > Joe > > > ----- Original Message ----- > From: "Ruslan Sivak" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Sunday, September 08, 2002 5:24 PM > Subject: iif usage > > > > Hi, I'm having a problem with iif. > > > > If I do > > > > #iif(qryCustomer.allareas,DE("All > > Areas"),DE("#ValueList(qryAreas.name,', ')#"))# > > > > and qryCustomer.allareas is true, therefore qryAreas is undefined (I > > check for it with an cfif somewhere else), then I get an error > > "Parameter 1 of function ValueList which is now "qryAreas.name" must > be > > pointing to a valid query name" > > > > If I make it > > > > #iif(qryCustomer.allareas,DE("All > Areas"),DE("ValueList(qryAreas.name,', > > ')"))# > > > > then it works fine in this case, but fails when qryCustomer.allareas > is > > false as it doesn't evaluate the ValueList(qryAreas.name,', ') > > > > What am I doing wrong? > > > > Russ > > > > > > ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists