Ask a Question related to ASP Database, Design and Development.
-
djc #1
len(variable) for sql?
I know that vb has the len() function that will return the number of
characters in a string. Does T-SQL have an equivelent for querying fields?
For example, I would like to write a query that returns the number of
records who's password field is < 7 characters?
can I?
djc Guest
-
#39634 [NEW]: session variable and normal variable
From: erhanbaris at gmail dot com Operating system: Win Xp SP1 PHP version: 5.2.0 PHP Bug Type: Variables related Bug... -
#39251 [NEW]: variable variable class array property is read only
From: taskfreak at gmail dot com Operating system: mac os PHP version: 5.1.6 PHP Bug Type: Class/Object related Bug... -
#22237 [Com]: PHP crashes when class references property using variable variable
ID: 22237 Comment by: rep at devdomain dot com Reported By: peter at globalvision dot com dot au Status: Closed... -
passing javascript variable into asp variable using vbscript
The subject pretty much sums up what I need to do. Here is what I have so far, but still can't figure out how to get it working: <script... -
Datalist - how (if) to use a sub variable or session variable in the footer?
Hi, sorry to be greedy with all my posts lately, but can you tell I'm doing new things this week? I've just done my first datalist (a simple... -
Ray at #2
Re: len(variable) for sql?
Yes, it's called LEN. :] Do you have the SQL Server Books Online?
select something from somewhere where len(something) < 7
Ray at work
"djc" <noone@nowhere.com> wrote in message
news:%23CaPaNlmDHA.3320@tk2msftngp13.phx.gbl...> I know that vb has the len() function that will return the number of
> characters in a string. Does T-SQL have an equivelent for querying fields?
> For example, I would like to write a query that returns the number of
> records who's password field is < 7 characters?
>
> can I?
>
>
Ray at Guest
-
djc #3
Re: len(variable) for sql?
thanks ray. re: server books online... got the hint.
: )
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:OoXl6OlmDHA.2216@TK2MSFTNGP12.phx.gbl...fields?> Yes, it's called LEN. :] Do you have the SQL Server Books Online?
>
> select something from somewhere where len(something) < 7
>
> Ray at work
>
> "djc" <noone@nowhere.com> wrote in message
> news:%23CaPaNlmDHA.3320@tk2msftngp13.phx.gbl...> > I know that vb has the len() function that will return the number of
> > characters in a string. Does T-SQL have an equivelent for querying>> > For example, I would like to write a query that returns the number of
> > records who's password field is < 7 characters?
> >
> > can I?
> >
> >
>
djc Guest
-
Aaron Bertrand [MVP] #4
Re: len(variable) for sql?
DATALENGTH()
(Advantage over LEN() is that it also works for text, ntext, etc.)
"djc" <noone@nowhere.com> wrote in message
news:#CaPaNlmDHA.3320@tk2msftngp13.phx.gbl...> I know that vb has the len() function that will return the number of
> characters in a string. Does T-SQL have an equivelent for querying fields?
> For example, I would like to write a query that returns the number of
> records who's password field is < 7 characters?
>
> can I?
>
>
Aaron Bertrand [MVP] Guest
-
Harag #5
Re: len(variable) for sql?
doesn't DATALENGTH() return the number of bytes not the number of
characters?
eg:
DECLARE @chvnText NVARCHAR(30)
SET @chvnText = N'text'
PRINT DATALENGTH(@chvnText)
returns 8 not 4
(unless you use VARCHAR and not NVARCHAR)
HTH
Al.
On Sun, 26 Oct 2003 10:18:55 -0500, "Aaron Bertrand [MVP]"
<aaron@TRASHaspfaq.com> wrote:
>DATALENGTH()
>
>(Advantage over LEN() is that it also works for text, ntext, etc.)
>
>
>
>
>
>"djc" <noone@nowhere.com> wrote in message
>news:#CaPaNlmDHA.3320@tk2msftngp13.phx.gbl...>>> I know that vb has the len() function that will return the number of
>> characters in a string. Does T-SQL have an equivelent for querying fields?
>> For example, I would like to write a query that returns the number of
>> records who's password field is < 7 characters?
>>
>> can I?
>>
>>Harag Guest
-
Aaron Bertrand [MVP] #6
Re: len(variable) for sql?
Yes, if it's ntext or nchar or nvarchar, you'd divide by 2. Still more
useful than len.
"Harag" <harag@softGETRIDOFCAPLETTERShome.net> wrote in message
news:bdgopvc9d17lavkhlrs22b10i75ucdpij3@4ax.com...fields?>
> doesn't DATALENGTH() return the number of bytes not the number of
> characters?
>
> eg:
>
> DECLARE @chvnText NVARCHAR(30)
> SET @chvnText = N'text'
>
> PRINT DATALENGTH(@chvnText)
>
> returns 8 not 4
>
> (unless you use VARCHAR and not NVARCHAR)
>
> HTH
>
> Al.
>
>
>
> On Sun, 26 Oct 2003 10:18:55 -0500, "Aaron Bertrand [MVP]"
> <aaron@TRASHaspfaq.com> wrote:
>> >DATALENGTH()
> >
> >(Advantage over LEN() is that it also works for text, ntext, etc.)
> >
> >
> >
> >
> >
> >"djc" <noone@nowhere.com> wrote in message
> >news:#CaPaNlmDHA.3320@tk2msftngp13.phx.gbl...> >> I know that vb has the len() function that will return the number of
> >> characters in a string. Does T-SQL have an equivelent for querying>> >> >> For example, I would like to write a query that returns the number of
> >> records who's password field is < 7 characters?
> >>
> >> can I?
> >>
> >>
Aaron Bertrand [MVP] Guest
-
djc #7
Re: len(variable) for sql?
Thanks!
"Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
news:uyPC6R9mDHA.2216@TK2MSFTNGP12.phx.gbl...fields?> DATALENGTH()
>
> (Advantage over LEN() is that it also works for text, ntext, etc.)
>
>
>
>
>
> "djc" <noone@nowhere.com> wrote in message
> news:#CaPaNlmDHA.3320@tk2msftngp13.phx.gbl...> > I know that vb has the len() function that will return the number of
> > characters in a string. Does T-SQL have an equivelent for querying>> > For example, I would like to write a query that returns the number of
> > records who's password field is < 7 characters?
> >
> > can I?
> >
> >
>
djc Guest



Reply With Quote

