+ Reply to Thread
Results 1 to 9 of 9

Creating Null fields in Access

  1. #1
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Creating Null fields in Access

    Hi All...

    Probably a simple solution but I can't get it to work...

    I have a database that I want to use an Update Query on to change a specific field (Location_ID) that has text in it to a Null (ie. nothing in it).

    I tried the double quotes, single quotes and the Null command, but all return a "0 records will be updated" comment....

    Am I doing this right?

    Please see attached screenshot of my Update Query design.

    Thanks.

    BTW: My Select Query with the same criteria shows that I have 11 records that should be updated
    Attached Images Attached Images
    Last edited by NBVC; 01-13-2009 at 10:34 AM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  2. #2
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Hi Vittorio

    Doing exactly what you have works for me in Access 2002.

    Richard
    Richard Schollar
    Microsoft MVP - Excel

  3. #3
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    null should work

    If the query is changed to a select query and run, it should return the rows that will be updated. Do you get any rows returned when you try this?

    Otherwise I am not sure what the "is not null" condition achieves, it can probably be excluded

    Regards

    Dav

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Creating Null fields in Access

    If the target is an Access table, try using Dbl-Quotes (") for text and an asterisk (*) for wildcards.
    Example:

    Please Login or Register  to view this content.
    If it's not an MSA table, the issue maybe syntax specific to the database you're linking to.

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Thanks for the responses guys...

    It seems like it might be the syntax that Ron is talking about that causes the issue....

    If I change the criteria of the first field to 'FS0587' (no wildcarding), then it will say it is going to update the 11 records...

    But I do want to wildcard it because sometimes the string may be contained within other strings and I want to update those too.

    The Table is a link to our database that is on an Oracle server.... using the same syntax and running a Select Query works and shows all records...so why not the Update Query?

  6. #6
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    Well if it is the selection try

    Like "FS0587"&"*"

    Does that work

    Regards

    Dav

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Well guys it seems that it should be: Like 'FS0587*'

    That one worked as a wildcard.... strange that the % worked on the Select but not the Update...

    Thanks to All for the help.
    Last edited by NBVC; 01-13-2009 at 10:34 AM.

  8. #8
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Under Tools>Options you should be able to specify ANSI standard SQL in your queries in which case the % should work. I presume it will work even if it is a linked table to Oracle (but I do not know that for sure).

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Thanks Richard,

    I ran the query already... so I will try that the next time I need to use a wildcard in Update Query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1