Results 1 to 6 of 6
  1. #1
    marley is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    4

    Filter on #Num!

    Hi all,

    I have a linked table that returns a #Num! error from a linked Excel (not a problem).



    What I want to do is run a query on that linked table to only return the row containing the #Num! error. What sql filter can I use to do this?

    eg.
    Linked Table------------------------------------------------------
    Row 1 (formatted as text) Row 2 (formatted as number)
    Text Entered Here 1 1.25
    Text Entered Here 2 #Num!

    Desired Query Result-----------------------------------------------
    Row 1 (formatted as text) Row 2 (formatted as number)
    Text Entered Here 2 #Num!

    So far my filter criteria of =#Num! or ='#Num!' is not working.

    Thanks

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    What is the data type of the field containing #Num!?

    If it's a String (I dont' know what else it could be really, but I guess you never know), then you should be able to just check for ="#Num!".

    Not sure why that's not working for you, unless you're not using double quotes.

  3. #3
    marley is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    4
    The Access field is Number and is returning an error as the item brought through from the Excel is a string.

    As the field is number, the error value of #Num! doesn't seem to be able to be caught in a text filter of ="#Num!". That is why I tried an expression to change this field into another format (General Number) using the IsError expression.

    I have now also tried concatenating the field with the text column and filtering as a LIKE but this has not yet worked either.

    Any tips?

  4. #4
    marley is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    4
    The data type of the Access field is Number (and is returning an error as the value being pulled through is a letter). When a filter criteria of text (e.g. ="#Num!") is passed, the error is not filtered.
    I have tried concatenating the field with a text one to force a reformatting of the data and performing a LIKE"#Num!" but this has not worked yet either.

    I have also tried using IsError([Row 2]) to make values returned 0 if there is no error and then filtering on the value of 0 but this has not yet worked either.

    Any other tips?

    ----Sorry for the duplication, my computer crashed during the post
    Last edited by marley; 07-28-2010 at 06:47 AM. Reason: Page crashed during post

  5. #5
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Ah, if you're using a Number field, then check the contents using the IsNumeric() function like so:

    Code:
    SELECT * FROM tblTable WHERE Not IsNumeric([ContainsNumbers])
    That should return only the Records you're looking for.

    A better way to handle the Import though, would be to dump the data into a temporary Table and then copy the Records from there. That would allow you to do better error checking and give you more control over the data types of the fields.

  6. #6
    marley is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    4
    Thank you Rawb, that worked a treat! A big chunk of good karma is heading your way now.

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

Similar Threads

  1. How do I filter on this ?
    By _Chris_ in forum Access
    Replies: 7
    Last Post: 08-12-2010, 08:34 PM
  2. VBA Filter
    By ntallman in forum Programming
    Replies: 7
    Last Post: 04-06-2010, 10:53 AM
  3. Filter button
    By tomeem in forum Access
    Replies: 0
    Last Post: 08-28-2009, 12:50 AM
  4. How do you filter repot?
    By archie in forum Reports
    Replies: 9
    Last Post: 08-26-2009, 10:50 PM
  5. Combo Box Filter
    By jgelpi in forum Programming
    Replies: 3
    Last Post: 07-27-2009, 12:54 PM

Tags for this Thread

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