Results 1 to 7 of 7
  1. #1
    tombarberio is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2014
    Posts
    4

    Remove data if field value is zero

    Good afternoon. Please be patient as I am a first time poster.
    I have an inventory Datasheet.
    The following headers are present. Name Part Shelf Stock
    I would like to build a Query, Report, Table, (pretty much anything) that will take my entire Datasheet and remove
    any Horizontal row that has a 0 (zero) in BOTH Shelf and Stock on the same Horizontal line.

    Name Part Shelf Stock
    Tom 001 1 0
    JoAnn 002 0 1
    Ed 003 0 0

    If this was my Datasheet, this is what I would like returned upon running this Query, Report, Table:
    Name Part Shelf Stock
    Tom 001 1 0
    JoAnn 002 0 1

    I would like the main Datasheet to remain intact, only the Query would have the omitted information.
    Please, please, advise.


    T.B.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Welcome to the forum.

    First, "Name" is a reserved word in Access and shouldn't be used as object names.
    http://www.allenbrowne.com/AppIssueBadWord.html

    You can create a query that will filter (omit) records.
    Try this (air code)
    Code:
    SELECT [Name], Part, Shelf, Stock FROM YourTableName WHERE Shelf > 0 AND Stock > 0;
    Replace "YourTableName" with the actual table name.

  3. #3
    tombarberio is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2014
    Posts
    4
    I appreciate your quick response and it seem like it may work, HOWEVER, I have no idea what to do with the information you have provided...if you or someone else out there could take the time to explain how to implement the above advice that would really be a big help.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Use the query builder. Steve has given you the syntax for a query that can be constructed with the Access query builder. Switch the builder to SQL View to see the SQL statement. You can even copy/paste the statement given and just type in the correct table name then switch back to design view.

    Using the query builder is basic Access functionality. Access Help will have more guidelines.
    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.

  5. #5
    tombarberio is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2014
    Posts
    4
    Okay, got it. Now the example I used had much less data than my actual Datasheet. So now my question is how can I easily take all of my Headings and move them into the SQL View? Is there a way to copy/paste? There are approx 20 heading which I would have to use. Thank you all again!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Not sure what you mean by 'move'. In query design view select whatever fields you want on the Field row of the design grid.
    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.

  7. #7
    tombarberio is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2014
    Posts
    4
    Awesome! Resolved! Thanks again!!!

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

Similar Threads

  1. How to remove extra spaces from a field?
    By accessmatt in forum Queries
    Replies: 1
    Last Post: 09-22-2014, 06:57 AM
  2. Remove field scroll bar
    By Daimios in forum Forms
    Replies: 4
    Last Post: 06-04-2014, 02:30 AM
  3. Use database to remove data from another?
    By James_ in forum Access
    Replies: 8
    Last Post: 01-23-2012, 09:49 AM
  4. Remove lines from Memo field
    By bvallez in forum Programming
    Replies: 5
    Last Post: 08-08-2011, 06:40 PM
  5. Remove contents from each field
    By nancyszn in forum Access
    Replies: 7
    Last Post: 08-06-2009, 03:41 PM

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