Results 1 to 4 of 4
  1. #1
    shanmugamgsn is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    17

    Null as Character in MS ACCESS 2003 Queries

    Hi All,



    Table T1:
    Column a Column b
    1 Sony
    Nokia
    3 Samsung
    HTC


    I have following query

    Select * from Table t1
    where t1.a Like ("*" & LTRIM(RTRIM([forms]![Search1]![cboInput1])) & "*")

    By default when input is empty i need all values.

    Here when my prompt value is empty i'm getting only "Nokia and HTC"
    But i wish to get all 4 values. Is it possible?

    I know in Oracle when i give

    Select * from Table t1
    where t1.a Like '%%'

    This gives all values in Oracle.
    But why not in MS ACCESS?

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I actually only get "Sony and Samsung" to return using your code.

    Nulls often give Access fits. Try this variation:
    Select * from Table t1
    where NZ([a],"") Like ("*" & LTRIM(RTRIM([forms]![Search1]![cboInput1])) & "*")

  3. #3
    shanmugamgsn is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    17
    Ok will try and update soon..


    Quote Originally Posted by JoeM View Post
    I actually only get "Sony and Samsung" to return using your code.

    Nulls often give Access fits. Try this variation:
    Select * from Table t1
    where NZ([a],"") Like ("*" & LTRIM(RTRIM([forms]![Search1]![cboInput1])) & "*")

  4. #4
    shanmugamgsn is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    17
    Thanks man that worked out

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

Similar Threads

  1. Export from Access 2003 to Excel 2003 - missing fields
    By Jack Sheet in forum Import/Export Data
    Replies: 1
    Last Post: 02-29-2012, 04:09 PM
  2. Return a value of zero for null queries
    By adacpt in forum Access
    Replies: 2
    Last Post: 01-22-2012, 07:41 PM
  3. Merge 2 queries with null? values
    By PrintShopSup in forum Queries
    Replies: 2
    Last Post: 10-03-2011, 09:09 PM
  4. Microsoft Access 2003 Import Issue- randomly cutting out first character
    By Bertimismaximus in forum Import/Export Data
    Replies: 9
    Last Post: 09-13-2011, 02:53 PM
  5. Replies: 1
    Last Post: 09-06-2006, 11:48 AM

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