[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
- Subject: Re: Substring within where clause
- From: Bob Helm <Bob.Helm@MEDIWARE.COM>
- Date: Thu, 23 Aug 2001 10:35:14 -0500
I really don't know if you can use substr in a WHERE clause, but
perhaps you could put the field into a variable for manipulation, like:
---------------------------------------
begin-select
A.ACAD_STATS_PERIOD $acad_stats_per
FROM PS_STAT_PERIOD_TBL A
WHERE substr($acad_stats_per,1,15) = $H_Academic_Term
end-select
----------------------------------------
Maybe that might help, maybe?
B
The Programmer formerly known as Bob
Mediware Information Systems Inc.
(913) 307-1045
Bob.Helm@Mediware.com <mailto:Bob.Helm@Mediware.com>
-----Original Message-----
From: Sarah Moore [mailto:smoore@NWTC.TEC.WI.US]
Sent: Thursday, August 23, 2001 10:07 AM
To: SQR-USERS@list.iex.net
Subject: Substring within where clause
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!