My piece sent prior to this would probably work better if made as part
of
Your query statement to the database.

Conrad


-----Original Message-----
From: Aidan Whitehall [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 13, 2001 12:55 PM
To: CF-Talk
Subject: Iif, short circuit evaluation and DE


Is there any way to use Iif with (for example) a date time variable
retrieved from a database so that if it's defined, it extracts the Day
portion of the date, but if the date is null, uses Day(Now()) instead?

   If(NOT Len(AccountExpires), DE(Day(Now())), DE(Day(AccountExpires)))

When AccountExpires is null, Day(AccountExpires) throws this error

   Parameter 1 of function Day which is now "" must be a date/time value

even though it's in the second part of the Iif. I would have thought the
evaluation wouldn't have got that far... ?

And as this is within a CFMODULE attribute, I want to use Iif if
possible, as opposed to having CFIF CFELSE /CFIF and two calls to the
custom tag.

BTW, are there times when you don't need to use DE within and immediate
if? I'm not 100% certain so always put it there.



Thanks

-- 
Aidan Whitehall <[EMAIL PROTECTED]>
Macromedia ColdFusion Developer
Fairbanks Environmental +44 (0)1695 51775
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to