[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Substring within where clause



also
WHERE substr(&A.DESCR,1,15) = $H_Academic_Term
You dont need to put the '&' in the where class.
Try this
WHERE substr(A.DESCR,1,15) = $H_Academic_Term

--- John Letourneau <jml@KSU.EDU> wrote:
> You should be able to put substr(A.Descr,1,15) =
> $H_Academic_Term
> (assuming that the DESCR that you are substringing
> is from the
> PS_STAT_PERIOD_TBL.  What error did it give when you
> tried this?
>
> jml
>
> Sarah Moore wrote:
>
> > I need to select a field from a table based on a
> substring of a field
> > within that table.  I tried the following (and
> other variations), and
> > received select errors:
> > ---------------------------------------
> >  begin-select
> > A.ACAD_STATS_PERIOD
> > FROM PS_STAT_PERIOD_TBL A
> >
> > WHERE substr(&A.DESCR,1,15) = $H_Academic_Term
> >
> > end-select
> > ----------------------------------------
> > (I also tried it without the & before A.DESCR and
> got errors...)
> > Is it even possible to use substring within the
> where clause?  Any
> > suggestions would be greatly appreciated!


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/