Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2012
    Posts
    111
    Provided Answers: 1

    Unanswered: Query Returns Crossjoin Results

    Hi all,

    Using Access 2016.

    The query below returns both pm1=pm2 and pm2=pm1, I just need the former.
    How can I limit the results of the query?

    Code:
    SELECT
         a.ASSET_ID AS pm1_assetid, 
         IIf(IsNull([a].[time in]),[a].[work_datetime],[a].[time in]) AS pm1_timein, 
         a.[SR #] AS [pm1_sr#], a.work_date AS pm1_workdate, 
         b.ASSET_ID AS pm2_assetid, 
         IIf(IsNull([b].[time in]),[b].[work_datetime],[b].[time in]) AS pm2_timein, 
         b.[SR #] AS [pm2_sr#], 
         b.Work_Date AS pm2_workdate, 
         [pm1_sr#]<>[pm2_sr#] AS Expr1
    FROM 
         [tbl pm w asset_id] AS a 
    INNER JOIN 
         [tbl pm w asset_id] AS b 
    ON 
         (a.Work_Date = b.Work_Date) 
    AND 
         (a.ASSET_ID = b.ASSET_ID);
    thx

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    630
    Provided Answers: 34
    Return 3=3 but not 3=3?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •