U2U CAML Query Builder is a must have tool for SharePoint developers, but today it was giving me grief.
I have a calculated column called ‘Duration (months)’. I wanted to find items where duration is less than 24 and more than 6.
I used U2U to generate the query using LT and GT but it was returning no items. The weird thing is when I removed the AND (i.e. single condition) or replace the AND with OR, then it was returning items.
It turns out that it was because U2U was putting ‘Calculated’ as the Value Type. When I changed the type to ‘Number’ (i.e. the OutputType of the calculated field) then everything works!