Results 1 to 8 of 8
  1. #1
    jset818 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    38

    Ignore blanks and <0 criteria

    Hi everybody, I'm new to the forums. I recently got a job as a data coordinator for a travel company. I have never used Access in my life prior to this job. I have a very newbie question that to you guys the solution is probably very obvious but I can't seem to get it to pull the right data. So I have all these fields with the <0 criteria, which worked for awhile because all we wanted was to pull negative values. But recently, the table we been using has alot of blank values in the first couple rows. This prevents me from running the query then, it would say something like "Datatype Mismatch".
    Click image for larger version. 

Name:	crit screen.JPG 
Views:	10 
Size:	42.1 KB 
ID:	18279


    I thought about just changing the criteria to Not like Null and <0 but every time I would try to make any changes to the criteria field, it would add quotation marks around 0. Like so.
    Click image for larger version. 

Name:	crit screen 2.JPG 
Views:	10 
Size:	21.1 KB 
ID:	18280
    I'm think this occurs because the query was made in Access 2003 and I'm using Access 2010. They implemented the auto-complete feature in Access 2010. Sure, I can run the query but it's not pulling the correct data. Sometimes it doesn't pull those fields with the negative values. Any help is appreciated.

    Edit: What I want is the query to ignore the blanks and only pull the negative values.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    dont use LIKE
    try: IS NOT NULL and <0

  3. #3
    jset818 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    38
    Quote Originally Posted by ranman256 View Post
    dont use LIKE
    try: IS NOT NULL and <0
    Yeah, it's still putting quotes around my 0. Making it IS NOT NULL <"0". Is <"0" the same as <0?

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    no, not same
    That usu means the field is a text. Is it text?

    But its
    IS NOT NULL AND <0

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Looks like pulling records from a query Allergen_Master_Query. Why not directly from table? Show the SQL statement of Allergen_Master_Query.
    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.

  6. #6
    jset818 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    38
    Quote Originally Posted by ranman256 View Post
    no, not same
    That usu means the field is a text. Is it text?

    But its
    IS NOT NULL AND <0
    In the Allergan Master Query Excel file, those fields are formatted as General. I wonder if I change the format to Number, maybe that will stop it from adding quotes around my 0.

    By the way, the table is called Allergan Master Query. It's not really a query. Just an excel file.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    So this is a linked spreadsheet? Setting cell format might help but don't bet on it. Can only try.
    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.

  8. #8
    jset818 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    38
    Okay, I was able to solve the issue by reformatting the appropriate fields in the excel file to Number format (it was General before). The quotes are gone now. I don't even need to ignore the blanks, it does it on its own. Thanks everyone.

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

Similar Threads

  1. Sorting Blanks
    By WickidWe in forum Queries
    Replies: 1
    Last Post: 12-11-2013, 03:23 PM
  2. if Form is closed ignore Query criteria
    By quicova in forum Queries
    Replies: 3
    Last Post: 09-20-2013, 04:50 PM
  3. Criteria Needs to Ignore Weekends
    By RichardAnderson in forum Queries
    Replies: 41
    Last Post: 08-30-2013, 08:22 AM
  4. Too many blanks in Labels
    By george3095 in forum Access
    Replies: 4
    Last Post: 12-15-2012, 09:50 AM
  5. SQL Update with blanks
    By Tyork in forum Programming
    Replies: 1
    Last Post: 12-17-2010, 10:12 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