are you trying to do something like:
#Iif(not Len(Trim(Form.Field)), "null",
"#chr(39)##Trim(Form.Field)##chr(39)#")#


see if that is what you are looking for....
----- Original Message -----
From: "Aidan Whitehall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 05, 2003 3:52 PM
Subject: [ cf-dev ] Apostrophes in Iif()


I want to be able to write an SQL statement using Iif() and my machine
is grinding to a halt whilst trying to get the syntax right (it seems to
occur when there's a particular combination of quotes and apostrophes).

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)) &
"'")#

(doublequote-apostrophe-doublequote-ampersand etc etc)

With the code above, if Form.Field is supplied, it's evaluating it but
not adding the apostrophes.


Thanks

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

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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