The CAML query to get the assigned to and to groups for the current user is
in a string format to copy
<FieldRef Name=’AssignedTo’ />
<FieldRef Name=’AssignedTo’ LookupId=’TRUE’ />
<FieldRef Name=’Status’ />
The “<Membership>” tag contains an attribute “type” , this attribute can contains 5 static values , below the description for each one:
1-“SPWeb.AllUsers” : this value is used to identify the tasks assigned to users (not groups)
2-“SPGroup” : using this parameter you must add the group ID like that:
<Membership Type=”SPGroup” ID=”7″>
This parameter will return list of tasks assigned to members of this group.
3-“SPWeb.Groups” : The tasks assigned to the group site collection appear but not the tasks assigned to specific groups site.
4-“CurrentUserGroups ” : The tasks assigned to the current user groups will appear but not tasks assigned directly to the user.
5-“SPWeb.Users” : Tasks assigned to users who have received rights to the site directly (not through a group).
Don’t put your CAML query inside the code block
//CAML query will not work here in a right manner
it will not retrieve the right data because the current user will changed in this case
The MSDN documentation for that from here http://msdn.microsoft.com/en-us/library/aa544234.aspx
And thanks for this post that described all values with example http://christopherclementen.wordpress.com/2012/08/27/caml-query-membership-attribute
hope it help you