Sorry, the form field not the null you want heh

So u need this


#Iif(not Len(Trim(Form.Field)), "null", DE("'#Trim(Form.Field)#'"))#

Russ michaels
Macromedia Certified ColdFusion Developer
 
Satachi Internet Development
----------------------------
Tel: 0870 7873610
Tech Support: 0906 9607800
Customer Support: 0709 2300330
Fax: 07092 212 636
www.satachi.com
 
Join our CFDeveloper discussion lists
e-mail: [EMAIL PROTECTED]

-----Original Message-----
From: Aidan Whitehall [mailto:[EMAIL PROTECTED]] 
Sent: 05 February 2003 15:53
To: [EMAIL PROTECTED]
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]


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