Results 1 to 4 of 4
  1. #1
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69

    Question Need help with a Like statement

    Hi,
    I am have an Excel table that I have successfully imported in to a table, How ever the last few lines will always have heading information that will always be the same. One line starts with "Client", the 2nd line starts with "Confidential" and the third line starts with "Generated". So I figured that I could look for these and just delete lines that start with these words. However, nothing that I have done so far works.
    If anyone has an idea I would appreciate it.
    Thank you



    Here is my code:

    Code:
    SELECT Left(tblTemp_Import_File.ID,6) AS test
    FROM tblTemp_Import_File
    WHERE tblTemp_Import_File.[ID] Like ("Client%") Or Like ("Confidential%") Or Like ("Generated%") Or Like ("Meritain%");

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    How about:
    Code:
    WHERE LEFT(tblTemp_Import_File.[ID],6) Not In ("Client","Confid","Genera","Merita");
    This will exclude any record where the ID field begins with any of these first 6 letters.

  3. #3
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69
    Hi,
    Thaks, but unfortuantly that returns thouse rows and all the other rows as well.

  4. #4
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69
    Sorry that did work I had to refresh.
    Thank you
    I really appreciate your help

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

Similar Threads

  1. if statement in sql statement, query builder
    By 54.69.6d.20 in forum Access
    Replies: 4
    Last Post: 09-11-2012, 07:38 AM
  2. Replies: 1
    Last Post: 01-13-2012, 02:59 PM
  3. Replies: 7
    Last Post: 08-17-2011, 01:49 PM
  4. Help with an Iif statement please
    By 10 Gauge in forum Programming
    Replies: 4
    Last Post: 04-05-2011, 06:02 AM
  5. IIf Statement
    By dref in forum Forms
    Replies: 2
    Last Post: 07-16-2010, 02:46 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