Duane,

Jason's advice is good.  In MS Access, use IIF and IsNull, like this:
   IIF(IsNull(Department),'N/A',Department)
where IIF's syntax is: IIF(expr, truepart, falsepart)

-David

On Saturday, March 10, 2001 3:12 PM, Jason Aden [SMTP:[EMAIL PROTECTED]] 
wrote:
> Why not try using a database function for it? Something like:
>
> <cfquery name="GetDiscountList" datasource="datasource">
>       select replace(discountList,NULL,0) AS discountList
>       from discounts
> </cfquery>
>
> That way the database can handle doing the replacement, which is a lot
> faster than having CF do it in a list.
>
> HTH,
>
> Jason
>
> ----
> Jason Aden
> Allaire Certified Developer
> [EMAIL PROTECTED]
> www.wwstudios.com
>
> > -----Original Message-----
> > From: Duane Boudreau [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, March 10, 2001 3:39 PM
> > To: CF-Talk
> > Subject: Replacement for Replace
> >
> >
> > Hi all,
> >
> > I have a list that I am working on that is 4000+ items plus. The list
> > unfortunately contains several "empty" items. Is there a way, other than
> > using Replace() to replace the empty items with a 0?
> >
> > This is what I have to deal with, but it is talking 1200 ms to process and
> > there is two more function calls just like it.
> >
> > <CFSET ProductDiscount = Replace(ValueList(GetDiscountList.DiscountList,
> > ";"), ";;", ";0;", "ALL")>
> >
> > PS, this is not my code. This is code I am trying to optimize.
> >
> > Thanks,
> > Duane

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