Re: adding a query as parameter using 'contains' logic



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


.



Relevant Pages

  • Re: Unicode Support
    ... > Not knowing much about UTF-8 (my Unicode knowledge extends as far as ... > literal strings of this form as long as the character code for quote ... > can never appear in a MBCS (multibyte character sequence). ... then XP Notepad directly understands UNICODE and you can ...
    (alt.lang.asm)
  • Re: Need help on string manipulation
    ... better to convert strings to UCS-32 before manipulation? ... Characters represented by wchar_t must use one wchar_t per character, ... which may use a multibyte encoding. ... use some newer Unicode characters, if this is a problem for you, then ...
    (comp.lang.c)
  • Re: Copying string to byte array
    ... of Strings and the CryptEncrypt + CryptDecrypt APIs. ... binary data should not be held in String variables. ... a) not all character codes are valid in a given ...
    (microsoft.public.vb.general.discussion)
  • Re: Unicode Support
    ... >> but labels. ... > character) are considered "invalid"... ... form from which you can compare strings. ... normalization forms -- compatible and canonical. ...
    (alt.lang.asm)
  • Re: GetOpenFilename()
    ... Specifies that the File Name list box allows multiple selections. ... the directory and file name strings are NULL ... You advance the pointer one character more. ...
    (microsoft.public.vc.language)