Results 1 to 7 of 7
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    IsNull clarification

    Hi

    building a query to update a field called notes with a format of long text

    I have built the update query which works (as per previous help from forum)



    I only want to update the records where the exisiting Notes field is empty,

    So I was thinking of using the criteria "IsNUll" in the update query for the field Notes.

    But searching google seems to show that IsNull only finds a lack of viable data not an empty field. I'm assuming that viable data in a long text field means any text or number will register as viable and therefore that field will not be updated

    Am I correct



    thanks

    Ian

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Use Is Null, not IsNull().

    Review

    http://allenbrowne.com/casu-12.html

    http://allenbrowne.com/QueryPerfIssue.html

    An empty string is not the same as Null. I don't allow empty strings saved in my text fields.

    However, can handle both with:

    [fieldname] & "" = ""
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,740
    Further to June's advice, use a select query with the appropriate IS NULL criteria to ensure you are selecting the proper records. Double check before doing the UPDATE query. Updates can be quite unforgiving if you mess up the criteria.
    Good luck.

  4. #4
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    hi

    Thanks

    Ian

  5. #5
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    "An empty string is not the same as Null. I don't allow empty strings saved in my text fields.

    Do you mean make it a required field? if so how do you cope with a field designated nee ( ie pre marriage name) if the person has never been married?

    thanks

    Ian

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,740
    Ian,

    From the computer perspective, an empty field can mean:
    -NULL
    -a zero length string (ZLS)
    -and in some cases people consider a blank or space to be empty.

    A NULL is undefined/unknown.
    A ZLS is a string with no length.
    A blank or space is a character.

    If you set a field's required property to Yes, then you must have a value.

    ISNull is an vba function.
    IS NULL is an SQL expression

    For more info:
    Errors with NULL

    IsNull

    SQL IS NULL
    Null and IsNull() differences

    Good luck.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    I set text field AllowZeroLength property to No. A field can be Null but cannot have empty (zero length) string.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Clarification on distrubution
    By Jen0dorf in forum Access
    Replies: 3
    Last Post: 11-05-2015, 12:57 PM
  2. Just Looking for Clarification...
    By faythe1215 in forum Programming
    Replies: 5
    Last Post: 02-06-2015, 09:03 AM
  3. One simple request - Clarification
    By shani20 in forum Access
    Replies: 2
    Last Post: 01-26-2015, 08:35 AM
  4. Query Performance Clarification
    By shabar in forum Queries
    Replies: 3
    Last Post: 01-29-2013, 03:38 AM
  5. clarification with transfer commands
    By mike02 in forum Access
    Replies: 7
    Last Post: 08-08-2012, 09:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums