compare two fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ozarka
    New Member
    • Oct 2007
    • 27

    compare two fields

    I am trying to create a query where tblfees2!fees_a llowed does not match tblfees.fees_al lowed. why the following is not working? I am not getting any result. I should get 2 records. because in my tblfees2 table there are two records one with null and other one has "S".
    Code:
    SELECT [tblFees].Acct_Num, [tblFees].Fees_Allowed, [tblFees2_on_Release].Fees_Allowed 
    FROM [tblFees] LEFT JOIN [tblFees2_on_Release] ON [tblFees].Acct_Num = [tblFees2_on_Release].Acct_Num
    WHERE [tblFees2_on_Release].[Fees_Allowed]<>[tblFees]![Fees_Allowed]
    OR [tblFees2_on_Release].[Fees_Allowed] Not Like [tblFees]![Fees_Allowed]
    Last edited by NeoPa; Nov 15 '07, 12:36 PM. Reason: Please use [CODE] tags
  • ozarka
    New Member
    • Oct 2007
    • 27

    #2
    HOW COME NO ONE NEVER HELPS ME.

    Here is the solution and hope it works for update query.

    Code:
    SELECT [tbl_Fees].Acct_Num, [tbl_Fees].Fees_Allowed, [tbl_Fees]!Fees_Allowed<>[tbl_Fees2_on_Release]!Fees_Allowed AS Compare, [tbl_Fees2_on_Release].Fees_Allowed
    FROM [tbl_Fees] LEFT JOIN [tbl_Fees2_on_Release] ON [tbl_Fees].Acct_Num = [tbl_Fees2_on_Release].Acct_Num
    WHERE ((([tbl_Fees]!Fees_Allowed<>[tbl_Fees2_on_Release]!Fees_Allowed)=-1))
    OR ((([tbl_Fees]!Fees_Allowed<>[tbl_Fees2_on_Release]!Fees_Allowed) Is Null))
    ORDER BY [tbl_Fees].Acct_Num;
    Last edited by NeoPa; Nov 15 '07, 12:36 PM. Reason: Please use [CODE] tags

    Comment

    • tezza98
      New Member
      • Mar 2007
      • 38

      #3
      try this

      Code:
      SELCT [tblFees].Acct_Num, [tblFees].Fees_Allowed, [tblFees2_on_Release].Fees_Allowed
      FROM [tblFees]
      INNER JOIN  [tblFees2_on_Release] ON tbl_Fees].Acct_Num = [tbl_Fees2_on_Release].Acct_Num
      WHERE [tblFees2_on_Release].[Fees_Allowed]<>[tblFees].[Fees_Allowed]
      you could even try

      Code:
      SELECT [tblFees].Acct_Num, [tblFees].Fees_Allowed, [tblFees2_on_Release].Fees_Allowed
      FROM [tblFees], [tblFees2_on_Release]
      WHERE tbl_Fees].Acct_Num = [tbl_Fees2_on_Release].Acct_Num
      AND [tblFees2_on_Release].[Fees_Allowed]<>[tblFees].[Fees_Allowed]
      stuff like this is pretty basic, thats probably why people didnt answer your question

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        Originally posted by Ozarka
        HOW COME NO ONE NEVER HELPS ME.
        In this particular instance I suspect it has something to do with the fact that only thirty minutes had elaspsed between the original posting of the thread and the time when you posted back with your own answer! This is not the first time you've exhibited this type of behavior. Perhaps you feel that this makes you look clever, answering your own questions when none of the experts have come up with an answer! What it says to me, however, is that you simply haven't taken the time to try and solve the question for yourself before posting it here!

        You have been repeatedly advised to use code tags in your threads, the reasons for this having been explained to you , and yet you continue to refuse to do so, as evidenced by today's post.

        You've asked our experts for help with a problem, and after they've spent time working on it for you, you simply decide you can't be bothered and break off the dialog.

        The experts on this forum donate their time and considerable talents to help others, without any expectation of compensation. If they have advice that is germane to your problem, they will share it with you, but they have careers and lives of their own, away from this forum, and are not here simply act as you private consultants.

        I would suggest that you take the time to read the Posting Guidelines and heed the advice of our moderators, when given. I would also suggest that you curtail your impatient attitude and give our moderators, experts and other members the respect they deserve.

        Any continuation of the above noted inappropriate behaviors will simply not be tolerated.

        Linq

        Moderator

        Comment

        Working...