[thelist] [SQL] determining if one column contains another?

Sean G. ethanol at mathlab.sunysb.edu
Mon Sep 29 15:47:38 CDT 2003


> >...  So I can't do something like,
> >
> > SELECT Result, RevComment, Comment
> > FROM tblResults
> > LEFT JOIN libComments
> > ON tblResults.RevComment LIKE %libComments.Comment%
>
> pretty close
>
> try this --
>
>     select Result, RevComment, Comment
>       from tblResults
>     left outer
>       join libComments
>          on charindex(libComments.Comment
>                      ,tblResults.RevComment) > 0
>

Ah, the beauty of simplicity.  I'm actually staying with Access for now
because of a crosstab issue (yeah, it turns out Access is good for
something) and am using InStr, but you got me on the right track.

Rudy, I'm sure your magnanificitude precludes acceptance of gratuities, but
a portion of my next paycheck is headed for the eVolt hat.


Sean G.





More information about the thelist mailing list