Results 1 to 2 of 2

Thread: Filtering

  1. #1
    Join Date
    Dec 1969

    Default Filtering

    &nbsp;<BR>I am looking to filter recordsets. If certain columns in the recordset are null, I want the recordset to be not shown. Should I do this by filtering or use an if statement?<BR>Example:<BR>objRec.Filter = "state = &#039; &#039;" Or<BR>If objRec("state" &#060;&#062; " ") then ---&#062;can you do this??<BR><BR>I know these are wrong....How can I filter records with null values.<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Why?

    Why do this in VBScript, *at all*. It&#039;s slow and clumsy.<BR><BR>Why not do it in SQL?<BR><BR> SELECT ... FROM yourTable WHERE state IS NOT NULL<BR><BR>*********<BR><BR>Neither of your choices work. You aren&#039;t looking for NULL with that code; you are looking for a *string* (text field) with exactly one space character in it. <BR><BR>I could understand that you might have a two character field that held two spaces if no state was given. But *ONE* space???<BR><BR>I&#039;m not sure you can use FILTER to get rid of NULLs.<BR><BR>You certainly could do it with VBS code, but again WHY?<BR><BR> If Trim("" & objRec("state")) &#060;&#062; "") then<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts