This is a discussion on Formula column. within the SQL Server forums, part of the Microsoft SQL Server category; --> HI, I have a problem in formula column. I have 8 1 bit varibles in a table for ex: ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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, Venkat. |
| ||||
| 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 -- "Venkat" <arunkvrr@yahoo.com> wrote in message news:f21476c8.0308281543.145ceff9@posting.google.c om... > 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, > Venkat. |