I tried that on the response.write end, but not the select. Will try it tomorrow, although all the googling I did this afternoon taught me that isull only returns .T. or .F. in vbscript. Boy wouldnt it be nice to have vfp on this server <grin>, but hell, I probably wouldnt remember that either as its been awhile..
Planned on doing this in .NET as I need to learn it, but decided I wasnt ready to take the time to learn it yet, when I can have this going in a few weeks. Darn .NET and the html portion fixed on the screen and the .net controls floating sure makes it hard to learn in my opinion, but its probably cause I'm doing something wrong... 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 Ricardo Aráoz Sent: Tuesday, December 19, 2006 6:50 PM To: ProFox Email List 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. > ISNULL ( check_expression , replacement_value ) Use it this way : Select isnull(possiblyNullField, ' ') as 'possiblyNullField' ........ It will return the fields contents if any or the replacement_value if the field is 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 > http://www.virgilslist.com > http://www.tccutlery.com > http://www.bierschwale.com > http://www.bierschwalesolutions.com > > > tablename = "roster" > > > fieldname1 = "svcbranch" > fieldname2 = "svcunit" > fieldname3 = "svcrate" > fieldname4 = "svcrank" > fieldname5 = "svclastname" > fieldname6 = "svcfirstname" > fieldname7 = "svccity" > fieldname8 = "svcstate" > fieldname9 = "svczip" > fieldname10 = "svconboard" > fieldname11 = "svcdeparted" > fieldname12 = "svclatitude" > fieldname13 = "svclongitude" > > connectstr = "Driver={SQL Server};SERVER=" & db_server & ";DATABASE=" > & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword > > Set oConn = Server.CreateObject("ADODB.Connection") > oConn.Open connectstr > > qry = "SELECT " & fieldname3 & ", " & fieldname6 & ", " & fieldname5 & ", " > & fieldname7 & ", " & fieldname8 & ", " & fieldname9 & ", " & > fieldname10 & ", " & fieldname11 & " FROM " & tablename & " where " & fieldname2 & " = '" > & svcBranch & "'" > Set oRS = oConn.Execute(qry) > > Response.Write("<table border='1' id='table7'>" & vbCrLf) > Response.Write("<tr>" & vbCrLf) > > > > Do until oRs.EOF > Response.Write("<td>" & vbCrLf) > Response.Write(oRs.Fields(fieldname3) & "</td>" & vbCrLf) > Response.Write("<td>" & vbCrLf) > Response.Write(oRs.Fields(fieldname6) & "</td>" & vbCrLf) > Response.Write("<td>" & vbCrLf) > Response.Write(oRs.Fields(fieldname5) & "</td>" & vbCrLf) > Response.Write("<td>" & vbCrLf) > Response.Write(oRs.Fields(fieldname7) & "</td>" & vbCrLf) > Response.Write("<td>" & vbCrLf) > Response.Write(oRs.Fields(fieldname8) & "</td>" & vbCrLf) > Response.Write("<td>" & vbCrLf) > Response.Write(oRs.Fields(fieldname9) & "</td>" & vbCrLf) > Response.Write("<td>" & vbCrLf) > Response.Write(oRs.Fields(fieldname10) & "</td>" & vbCrLf) > Response.Write("<td>" & vbCrLf) > Response.Write(oRs.Fields(fieldname11) & "</td>" & vbCrLf) > Response.Write("</tr>" & vbCrLf) > oRS.MoveNext > Loop > Response.Write("</table>" & vbCrLf) > oRs.Close > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] 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.

