Re: LiveWire/Informix - Select question
Posted in 1997
Henry Hartley (hartleh1@westat.com) wrote: }X-Informix-List-Id: <news.36410> } }kjackson@lerc.nasa.gov (Keith Jackson) wrote: }>Within a LiveWire app I have an Infomix table with a field called }>territory. The 3 and 4th characters of the territory are the sales }>office. I would like to do a select statement that can pull sales }>office off the territory field. }> }>For example: }> }>database.SQLTable(select * from mytable where }>substr(territory,2,2)='98') }> }>substr is NOT correct. Does anyone know (if it can be done) the }>correct syntax? I could use LIKE, but I need to pull out only the 3rd }>and 4th characters. } }substr is what it OUGHT to be but its just territory[2,2] instead. }Those are square brackets. Actually, the notation uses sqaure brackets, but it you specify the start and end positions, counting from 1, so the 3rd and 4th characters are found using territory[3,4], not territory[2,2]. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>