Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 max of bit field

Author  Topic 

tpiazza55
Posting Yak Master

162 Posts

Posted - 2008-08-07 : 10:23:50
how do i take the max of a bit field

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-08-07 : 10:27:18
cast it as an INT (or similar) maybe?

Em
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-08-07 : 10:33:23
or

select max(bit_col+0) from your_table

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-08-07 : 10:35:57
from OP on duplicate post...

quote:
Originally posted by tpiazza55

when i go max(cast(ready as integer) and i try to pull the value I get "ready" not in table



Em
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-08-07 : 10:39:06
quote:
Originally posted by elancaster

from OP on duplicate post...

quote:
Originally posted by tpiazza55

when i go max(cast(ready as integer) and i try to pull the value I get "ready" not in table



Em


It means the column name is not correct

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

tpiazza55
Posting Yak Master

162 Posts

Posted - 2008-08-07 : 10:39:21
thanks -- posted it tiwce

max(cast(ready as int) as ready got me what i needed
Go to Top of Page
   

- Advertisement -