I like using IIF, but only in very specific situations and I don't think in SQL is terribly appropriate.
Its not the worlds most efficient way of processing conditions, because CF has to evaluate all parts of it before it can work out whether the condition has been met or failed, cfif doesn't. So you have to type a bit more with CFIF, but its a hell of a lot more readable than IIF and this is from someone who likes to use IIF.... Stephen ----- Original Message ----- From: "Snake Hollywood" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 05, 2003 4:23 PM Subject: RE: [ cf-dev ] Apostrophes in Iif() > No confusion, it was easy. > > -----Original Message----- > From: Rich Wild [mailto:[EMAIL PROTECTED]] > Sent: 05 February 2003 16:18 > To: '[EMAIL PROTECTED]' > Subject: RE: [ cf-dev ] Apostrophes in Iif() > > > obviously, considering how much confusion its just thrown up. > > > -----Original Message----- > > From: Snake Hollywood [mailto:[EMAIL PROTECTED]] > > Sent: 05 February 2003 16:20 > > To: [EMAIL PROTECTED] > > Subject: RE: [ cf-dev ] Apostrophes in Iif() > > > > > > Because IIF rocks > > > > -----Original Message----- > > From: Stephen Moretti [mailto:[EMAIL PROTECTED]] > > Sent: 05 February 2003 16:15 > > To: [EMAIL PROTECTED] > > Subject: Re: [ cf-dev ] Apostrophes in Iif() > > > > > > Aiden, > > > > > Does anyone know the correct syntax which allows you to do > > something > > > like this (below) in a cfquery block, so that if anything > > was supplied > > > > > in a form field, it returns the string "null", otherwise, it's > > > evaluated and wrapped in single quotes: #Iif(not > > > Len(Trim(Form.Field)), "null", "'" & DE(Trim(Form.Field)) &"'")# > > > > > Your DE aren't in the right price. > > > > #IIF(not Len(trim(Form.fieldname)), > > DE("Null"),DE("'"&Trim(form.fieldname)&"'"))# > > > > but why not use > > > > <cfif Len(Trim(form.fieldname)) EQ 0>IS > > NULL<cfelse>'#Trim(form.fieldname)#'</cfif> > > > > Stephen > > > > > > > > -- > > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] For > > human help, e-mail: [EMAIL PROTECTED] > > > > > > -- > > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] For > > human help, e-mail: [EMAIL PROTECTED] > > > > > -- > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] For > human help, e-mail: [EMAIL PROTECTED] > > > -- > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > For human help, e-mail: [EMAIL PROTECTED] > > -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
