Thread: Query in Access

    #1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2002
    Posts
    608
    Rep Power
    16

    Query in Access


    Ok..I hate using Access compared to PHP/mysql, but it's for school.

    In the Access query design screen....
    How can I make a query pick only records that have a blank value in a certain field?

    Thank you everyone for your help!!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Location
    Netherlands
    Posts
    458
    Rep Power
    13
    Like:
    SELECT
    mytable.certainfield1,
    mytable.certainfield2,
    mytable.certainfield3
    WHERE
    mytable.certainfield2=Null;
  4. #3
  5. Second highest poster :p
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2001
    Posts
    7,322
    Rep Power
    33
    You can use NULL as per above, but sometimes i have had access not recognise a field as Null. The other problem happens when a user enters in a space in the field.

    Using a combination of Len & Trim gives you something that will handle those cases.

    SELECT
    mytable.certainfield1,
    mytable.certainfield2,
    mytable.certainfield3
    WHERE
    Len(Trim(mytable.certainfield2))=0;
    - Andreas Koepke

    Koepke Photography


IMN logo majestic logo threadwatch logo seochat tools logo