+ Reply to Thread
Results 1 to 5 of 5

Compare string in two columns (A and B)

  1. #1
    Registered User
    Join Date
    11-11-2013
    Location
    Silver Spring, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Compare string in two columns (A and B)

    Good evening all.
    I am trying to compare two string in column A and B and then display the differences in column C

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Compare string in two columns (A and B)

    What do you mean by differences? Is there a direct correspondence between the columns on the same row?

    Please post a few examples to clarify your problem.

    Pete

  3. #3
    Registered User
    Join Date
    11-11-2013
    Location
    Silver Spring, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Compare string in two columns (A and B)

    Hi Pete,

    e.g.

    Column A has. Select * from hcclco.patient where patient_id = '12345'
    Column B has, Select * from hcclco.patient ad pat where pat.patient_id = '12345'

    I would like the output to show the differences between column A and B

    Essentially the columns contain SQLs from Taradata and Oracle, so trying to show the diffences in syntax between the two dbms.

  4. #4
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Compare string in two columns (A and B)

    pls try as fallow

    first u need to join table hcclco.patient ( where patient_id =12345) and table hcclco.patient ad pat (where patient_id =12345)
    then store the difference of these columns value

    select * from hcclco.patient where patient_id = '12345' as a;
    Select * from hcclco.patient ad pat where pat.patient_id = '12345' as b;
    join a and b on (patient_id = pat.patient_id );
    select a,b, a-b as c;

    pls let me know if it helps...

  5. #5
    Registered User
    Join Date
    11-11-2013
    Location
    Silver Spring, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Compare string in two columns (A and B)

    I apologize for not being too clear.

    bottom line: I am trying to find a Excel function or vba script that can compare strings that are in column A and Column B of an excel spreadsheet and return the differences.

    The strings in my case happens to be Teradata and Oracles SQL statements.

    So Column A would have a Teradata SQL statement and Column B would have the equivalent Oracle SQL.

    background: We are converting from a Teradata platform to Oracle. We converted all the Teradata SQLs to the Equivalent Oracle SQL statement using a tool, which are documented in an Excel spreadsheet (about 283 statements) and are trying to highlight the differences

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Compare ranging part of a string in two columns
    By Jeroen79 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-04-2011, 09:52 AM
  2. Replies: 1
    Last Post: 08-23-2007, 01:10 PM
  3. Compare a string in two columns, if match then append string from third column
    By Londonderry in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-22-2007, 03:41 PM
  4. String compare doesn't compare?
    By Ken Soenen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2006, 11:45 AM
  5. How to compare two columns for a specified string?
    By jarski in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2005, 12:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1