all groups > sql server (alternate) > august 2003 >
You're in the

sql server (alternate)

group:

Formula column.


Formula column. arunkvrr NO[at]SPAM yahoo.com
8/28/2003 4:43:15 PM
sql server (alternate): HI,
I have a problem in formula column.
I have 8 1 bit varibles in a table
for ex: Flag1, falg2, flag3 ...Flag8
Now I want to create another variable as a small integer and copy all
the flgas to that field.
For ex:

(flag1 << 0x80) | (flag2 << 0x40) | ..... | flag8

I tried all possible ways?

Let me know how to write the formula for this column.

Thanks,
Re: Formula column. David Portas
8/30/2003 9:40:20 AM
Assuming you don't have any NULLs:

(flag1*128 | flag2*64 | flag3*32 | flag4*16 | flag5*8 | flag6*4 | flag7*2 |
flag8*1)

--
David Portas
------------
Please reply only to the newsgroup
--

[quoted text, click to view]

AddThis Social Bookmark Button