Yeah, I thought I could remember how the iif function worked in vb, but apparently its been longer then I thought.
I will figure it out tomorrow, had enough for tonight and thanks for the input. Virgil Bierschwale http://www.virgilslist.com http://www.tccutlery.com http://www.bierschwale.com http://www.bierschwalesolutions.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matthew Jarvis Sent: Tuesday, December 19, 2006 6:43 PM To: profox@leafe.com Subject: Re: [NF] null chr's and   Virgil Bierschwale wrote: > Ok, I have empty fields in sql server and I need to replace them with >   when they're null. > > Apparently vbscript is a lot different then what I did in the past and > I havent had much luck googling it. > > How do ya'll trap for null in the code below ? > > In the past I would have done it at before each response.write line, > but the few samples I have found don't seem to work. > > You can try out the code at http://www.virgilslist.com/branch.asp > > Thanks > > Virgil Bierschwale qry = "SELECT " & fieldname3 & ", " & fieldname6 & ", " & fieldname5 & ", " & fieldname7 & ", " & fieldname8 & ", " & fieldname9 & ", " & fieldname10 & ", " & fieldname11 & " FROM " & tablename & " where " & fieldname2 & " = '" & svcBranch & "'" Set oRS = oConn.Execute(qry) <snipped> I don't know if VB has a global setting (I doubt it) for handling nulls like VFP does i.e. SET NULL TO and SET NULLDISPLAY - but it might be worth looking for. You can convert the nulls in your query code with the CASE statement: Something like: CASE WHEN fieldname3 is null THEN ' ' ELSE fieldname3 END This is probably slower than doing something afterward as you write it out. Can't remember how VB supports (or not) the IIF construct. Does this help? Matthew S. Jarvis IT Manager Bike Friday - "Performance that Packs." www.bikefriday.com 541/687-0487 x140 [EMAIL PROTECTED] [excessive quoting removed by server] _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.