Re: logical and
From: Frank (frank_at_frank.com)
Date: 01/12/05
- Next message: Rami: "Re: IDENTITY reaches the max value"
- Previous message: Dan Guzman: "Re: sp_insertuser"
- In reply to: Dan Guzman: "Re: logical and"
- Next in thread: Steve Kass: "Re: logical and"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 12 Jan 2005 15:01:40 +0100
GREAT!!!!!
Frank
"Dan Guzman" <guzmanda@nospam-online.sbcglobal.net> schreef in bericht
news:uaWOg4K%23EHA.1296@TK2MSFTNGP10.phx.gbl...
> The bitwise AND logical operator in SQL Server is '&'. This expects
> integer values. Converting your binary values to integer:
>
> IF 8 & 193 = 193 PRINT 'true' ELSE PRINT 'false'
> IF 170 & 2 = 2 PRINT 'true' ELSE PRINT 'false'
>
> See Bitwize AND in the Books Online for more information.
>
> --
> Hope this helps.
>
> Dan Guzman
> SQL Server MVP
>
> "Frank" <frank@frank.com> wrote in message
> news:41e50fbc$0$6211$e4fe514c@news.xs4all.nl...
>> Hi,
>> I want to do a logical comparison between two tinyint-columns in a select
>> statement.
>> With logical I mean: if a bit in the tinyints are both 1 then comparison
>> is true.
>> 00001000 and 11000001 = false
>> 10101010 and 00000010=true
>>
>> Can this be done in SQLServer?
>> Thanks
>> Frank
>>
>>
>
>
- Next message: Rami: "Re: IDENTITY reaches the max value"
- Previous message: Dan Guzman: "Re: sp_insertuser"
- In reply to: Dan Guzman: "Re: logical and"
- Next in thread: Steve Kass: "Re: logical and"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|