| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Dan Nelson | Date: | March 24 2005 7:59pm |
| Subject: | Re: a very tricky string extraction | ||
| View as plain text | |||
In the last episode (Mar 24), Ed Reed said: > This is an interesting problem that I hope someone can help me with. I > have a varchar field that contains data like this, > > 01/01/05 SG Reviewed this > 12/15/03 DSD Reviewed that > 10/24/02 EWW Worked on that and tested this then stop to do something else > 05/02/01 AW Did something > 08/31/98 DSD Tested this > 07/22/97 EWW Worked on that and did something > > I need a Select statement that returns the Date for the first > occurance of the 'Tested this' substring > > So far what I've come up with doesn't quite get what I need and it's > already pretty hairy. I wonder if there's a more elegant way that I'm > unaware of. How about: SELECT LEFT(description, 8) FROM mytable WHERE description LIKE "%tested this%" LIMIT 1 -- Dan Nelson dnelson@stripped
| Thread | ||
|---|---|---|
| • a very tricky string extraction | Ed Reed | 24 Mar |
| • Re: a very tricky string extraction | Dan Nelson | 24 Mar |
| • Re: a very tricky string extraction | Keith Ivey | 24 Mar |
| • Re: a very tricky string extraction | Keith Ivey | 24 Mar |
| • Re: a very tricky string extraction | Joerg Bruehe | 24 Mar |
| • Re: a very tricky string extraction | SGreen | 24 Mar |
| • RE: a very tricky string extraction | Jay Blanchard | 24 Mar |
| • RE: a very tricky string extraction | Jay Blanchard | 24 Mar |
| • Re: a very tricky string extraction | Ed Reed | 24 Mar |
| • Re: a very tricky string extraction | SGreen | 24 Mar |
| • Re: a very tricky string extraction | Ed Reed | 24 Mar |
| • Re: a very tricky string extraction | Eamon Daly | 24 Mar |
| • Re: a very tricky string extraction | Keith Ivey | 24 Mar |
| • Re: a very tricky string extraction | Eamon Daly | 25 Mar |
| • Re: a very tricky string extraction | Ed Reed | 24 Mar |
