|
Selecting 'TRD' from the start of a field in the WHERE clause is easy. All you need to do is specify Field1 like 'TRD%'. Off the top of my head, I don't recall if you can do a substring directly in the WHERE clause or not. You may have to create a named field in the SELECT part and use that in the WHERE clause. Matt -----Original Message----- From: rpg400-l-bounces+matt.haas=thomson.com@xxxxxxxxxxxx [mailto:rpg400-l-bounces+matt.haas=thomson.com@xxxxxxxxxxxx] On Behalf Of Rowe, Sheri Sent: Wednesday, January 17, 2007 1:07 PM To: rpg400-l@xxxxxxxxxxxx Subject: SQL substring question Hi, I need to write a 'quick' interactive SQL statement to update a file based on the conditional field being a substring and the result field being a substring. FileA Field1 (7,A) position 1,3 contains many values, but I need only 'TRD' records and position 4-7 contains a customer number value e.g. TRD1100, TRD5555, TRD6789 etc Field2 (243,A) contains many values, but I need to extract positions 89-90 I need to update all Field1 'TRD' records where field2 position 89-90 = 'AA' to be value 'XX' Any help would be very appreciated. Thanks in advance. Sheri Rowe
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.