Results 1 to 4 of 4
  1. #1
    pushpm is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2009
    Posts
    9

    Query is not working

    I have two tables. One is 2nd Level AFDA and other InterCompany



    2nd Level AFDA has 5 fields and Intercompany has two.

    Both have SAPStrNo field comman. I want to join thes tables and ignore all the SAPStrNo records found in InterCompany. Following SQL query is not working.
    I have 1206 records in 2nd Level AFDA and 22 records in Intercompany. Following Query generate 26531 records which definetly wrong because I expect less than 1206 records due to this query


    SELECT [2nd Level AFDA].SAPStrNo, [2nd Level AFDA].StoreNo, [2nd Level AFDA].AccType, [2nd Level AFDA].Sortype, [2nd Level AFDA].Banner
    FROM [2nd Level AFDA] where [2nd Level AFDA].SAPStrNo <> InterCompany.SAPStrNo;

  2. #2
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    try:


    SELECT [2nd Level AFDA].SAPStrNo, [2nd Level AFDA].Storeno, [2nd Level AFDA].Acctype, [2nd Level AFDA].Sortype, [2nd Level AFDA].Banner
    FROM [2nd Level AFDA] LEFT JOIN Intercompany ON [2nd Level AFDA].SAPStrNo=Intercompany.SAPStrNo
    WHERE (((Intercompany.SAPStrNo) Is Null));

  3. #3
    pushpm is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2009
    Posts
    9
    Perfect. This worked.

    Thanks again.

  4. #4
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    you welcome. glad to help you out. and thanks for posting back your success.

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

Similar Threads

  1. Having - Like stops working
    By tdalber in forum Queries
    Replies: 0
    Last Post: 02-03-2009, 04:30 PM
  2. If name = test1 then let , NOT WORKING ?
    By caljohn527 in forum Forms
    Replies: 3
    Last Post: 01-21-2009, 04:01 PM
  3. public instead of dim not working
    By DKY in forum Access
    Replies: 1
    Last Post: 10-14-2008, 11:42 AM
  4. calculated sum not working!
    By Linda Gamble in forum Access
    Replies: 1
    Last Post: 10-12-2007, 06:38 AM
  5. Replies: 1
    Last Post: 11-29-2005, 08:47 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