Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Comparison with certain criteria

Status
Not open for further replies.
Sep 21, 2001
28
US
How do I come about comparing two tables using either VB coding or SQL. Both tables have the same field names, but the data is slightly different. Table 1 contains record with the full name. Table 2 contains table with the naming fields too, but only contain the first letter for each field: firstname, lastname, and middle initial. I would to know how do I come about comparing two set of data with the first character only. Please paste sample code if possible. Thanks.

T1: FName, LName, MI, ... (contains full name)
T2: FName, LName, MI, ... (all fields contain the first character only)

 
don't know what type of comparing you are wanting to accomplish, but you can create a query with all of the fields from table 1 plus and expression field(s) that contains only the first letter of the 3 names, and then create a second query which you join to the first query based on the expression field(s). The number of expression fields will be based on whether the data in table 2 is all in one field or 3 fields. If you use 3 fields for the names in table 1 then you can just use the Left() function to get the value [i.e. Left(FName,1), Left(LName,1), Left(MI,1)], however if they are all in one field, then you'll have to do some coding using the InStr() function to split out the necessary data.

PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top