You didn't mention database ... In Oracle you could use:
decode(instr(part_number, '.'), 0, part_number, substr(part_number, 1, instr(part_number) - 1)) = other_part_number You're idea of loading a master part number may yield better results depending on how big the tables are. Dan -----Original Message----- From: Phillip B [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 1:06 PM To: CF-Talk Subject: OT: SQL question I need to do this and don't know where to start. Compare part of a part number in one table to another table. The part numbers look like this. 12345.123 12345.234 12345.654 02nt911dc.123 02nt911dc.054 02thq5 02thq7 The part before the dot is all I want to use to compare to the other table which will only contain the first part. It would be something like this. 12345.123 = 12345 12345.234 = 12345 12345.654 = 12345 02nt911dc.123 = 02nt911dc 02nt911dc.054 = 02nt911dc 02thq5 = 02thq5 02thq7 = 02thq7 How would I do that using just sql statements? Maybe when I have the server import I could have it create an extra column that can contain a trimmed version of the part number. A master number of sorts. Just a thought. Thanks Phillip Broussard Tracker Marine Group 417-873-5957 ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists