Mines shorter so there :-)

-----Original Message-----
From: Aidan Whitehall [mailto:[EMAIL PROTECTED]] 
Sent: 05 February 2003 16:33
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] Apostrophes in Iif()


> #IIF(not Len(trim(Form.fieldname)),
DE("Null"),DE("'"&Trim(form.fieldname)&"'"))#

That's the ticket. Thanks, Stephen.


> but why not use
> 
> <cfif Len(Trim(form.fieldname)) EQ 0>IS 
> NULL<cfelse>'#Trim(form.fieldname)#'</cfif>

I just find Iif() more elegant in some instances, however dumb it makes
me feel when I screw it up  ;-)

BTW, thanks everyone that replied and, whilst it didn't help in this
instance, I came across this page which is really useful:
http://www.fusionauthority.com/iif.cfm


-- 
Aidan Whitehall <[EMAIL PROTECTED]>
Macromedia ColdFusion Developer
Fairbanks Environmental Ltd  +44 (0)1695 51775

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

-- 
** 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]

Reply via email to