Saturday, February 18, 2012

CAML Query Where Criteria for Boolean type columns

Interestingly enough, boolean type columns can either be used as Integer or Boolean values and heres how its done.
string CAMLQuery = "<Where> <Eq><FieldRef Name='Online'/> <Value Type='Integer'>1</Value></Eq> </And> </Where>" ;
or
string CAMLQuery = "<Where> <Eq><FieldRef Name='Online'/> <Value Type='Boolean'>True</Value></Eq> </And> </Where>" ;
where TRUE, True, true are all possible values

No comments: