Re: adding a query as parameter using 'contains' logic
- From: "Russell Fields" <russellfields@xxxxxxxxxx>
- Date: Wed, 14 Nov 2007 14:38:55 -0500
Texas Tonie,
If you want a range of values, look at the BETWEEN operator. For character
strings, however, the whole issue of collation and sort order needs to be
considered when defining what is between.
For your example problem, assuming that the 'number' is actually a character
string (not some sort of numeric datatype) and that the number may have
leading spaces, then you could use:
DECLARE @Value = ' 12345'
SELECT @Value WHERE LTRIM(@Value) LIKE '12345%'
FWIW,
RLF
"Texas Tonie" <TexasTonie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:72C622EC-3C49-41C7-8259-2274E9396CD3@xxxxxxxxxxxxxxxx
Hello,
Setting parameter ranges for a query is very useful.
How can I specify : begins with ...... and make that a parameter (in this
case first 5 digits of a project name)?
Liek '%[parameter3]%' does not work.
What should it be?
Help much appreciated,
An 'over-his-head' Texas Tonie
.
- Prev by Date: Re: Use distinct on one column but want 2 columns of data returned
- Next by Date: Re: Cross tab based on DateDIFF
- Previous by thread: Use distinct on one column but want 2 columns of data returned
- Next by thread: Re: adding a query as parameter using 'contains' logic
- Index(es):
Relevant Pages
|
|