Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you specify a range of fields in a query??

Status
Not open for further replies.

coder30

Programmer
Apr 7, 2006
16
US
I am trying to check 25 fields for null values is there a way to say... "iif([fieldeG] through [fieldZ]is null,1,0)
 
What did you want to use? A form or a recordset? For example:
Code:
For Each fld In rs.Fields
    If IsNull(fld) Then
        Debug.Print "Is Null"
    Else
        Debug.Print "Is Not Null"
    End If
Next
 
Thanks leslie.

Remou - that would work if the fields were truly null, but I've just discovered some of the fields contain spaces, so they aren't truly null.
 
How about

UPDATE myTable SET myField = Trim(myField)

to get rid of only-space fields and get NULL?
 
You will often see Trim(Field & " ") = "" used in these fora as it test for null, spaces and zero length strings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top