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]
