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

    Criteria for column with number and text values

    I'm trying to create a query that pulls any data (text or number) from the [Hyperion Code] field, but I want to exclude the data with 6 number digits. The issue I'm having is that the column from the source table is formatted as Text. Thus, making it difficult to set up a criteria for it. I tried reformatting source data format to Number, Text, and General but that usually causes the Text values to return as #Num.



    So I want to exclude 356673, 463001, 917000, 842700 etc.... from the column. How would I set up a criteria for this?

    Click image for larger version. 

Name:	Hyperion Code.JPG 
Views:	9 
Size:	23.3 KB 
ID:	18688

  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,930
    It looks like the 6-character values are all digits.

    WHERE Len([Hyperion Code])<>6
    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
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if it's important that the string be BOTH numeric AND 6 characters long to be excluded I would create a field like:

    Ind: IIf(IsNumeric([hyperion code]) And Len([hyperion code])<>6,0,1)

    then put in a criteria of 1 on the IND field to show all items that DO NOT match numeric/6 digits long

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Like it, but think need to = 6.

    Ind: IIf(IsNumeric([hyperion code]) And Len([hyperion code])=6,0,1)
    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
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    you're absolutely right, screwed up the sign.

  6. #6
    jset818 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    38
    Thanks guys. The iif function worked great. I did made some little adjustments to it because sometimes the hyperion code can be a single digit like 6.

    Hyperion Code: IIf(IsNumeric([hyperion code]) And Len([hyperion code])=6,"6 Digit Hyperion Code",[hyperion code])

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

Similar Threads

  1. Replies: 2
    Last Post: 07-09-2014, 12:43 PM
  2. Replies: 10
    Last Post: 05-22-2013, 02:56 PM
  3. Filter data by number as text column.
    By msadiqrajani in forum Access
    Replies: 14
    Last Post: 08-15-2012, 02:34 PM
  4. Replies: 2
    Last Post: 07-21-2012, 01:21 AM
  5. pulling text values into FK number column
    By REBBROWN in forum Database Design
    Replies: 2
    Last Post: 08-30-2010, 05:04 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