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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Comparisons

Status
Not open for further replies.

Gavuk

Programmer
Apr 16, 2003
32
GB
Hiya all,

Having a touch of trouble. Inporting data from excel (not important) into a temp table before committing the data to the "real" table we want to be able to do a comparison on the "Organisation Name", to see if the details already exist.

The best we have come up with so far is doing something like ... Compare against the left 5 chars ... then the right 5 chars ... and the mid 5 chars!!!! Giving us a recordset of possibilities (or none if it is a new item!).

Anyone got any better ways of doing this??

Cheers all.
 
How are ya Gavuk! . . . . .

You say : "we want to be able to do a comparison on the "Organisation Name", to see if the details already exist".

Just data is in the organization name? It appears to be more than just a name. Arethe details in a another field?

You need to be more specific . . . . .

TheAceMan [wiggle]
 
The organisation name is a string of anything between 1 and say 60 something along the line of "Argyle County Council". We have to compare new data coming in with existing data and if it exists link the new data with the old data, if it does not exist fine it just gets inserted into the various tables (there is all different types of data coming in being written to different tables!! but its a legacy database so its a mess and the only way to compare the new with the old is via a string comparison!!)

Not the best way i know but its the only way at the moment.

Cheers
 
OK . . . . Gavuk! . . . .

The best you can do is make a full comparison :

If OrganizationName = ComparsionName
Append to old data
else
perform insertion
End If



TheAceMan [wiggle]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top