Hi,
I copied this query from u2u query builder ,its working fine there but as I copy this query to my webpart
its returning all records from list not particular record according to where clause "parentID" (see in below query)
I want to utilize this query to pass id on where clause which is lookup field and retrieve record according to ID not all
How can I done this
SPQuery query = new SPQuery();
string strquery = "<Query>"+
"< Where >" +
"< And >"
+ " < Eq > "
+ " < FieldRef Name = 'PlantFk_x003a_ID' LookupId='TRUE' /> "
+ " < Value Type = 'number' > " + ParentID + "</ Value >"
+ " </ Eq > "
+ " < Eq > "
+ " < FieldRef Name = 'Flag' /> "
+ " < Value Type = 'Number' > 1 </ Value > "
+ " </ Eq > "
+ " </ And > "
+ " </ Where > "
+ " </Query>";
query.Query = strquery;
"< Where >" +
"< And >"
+ " < Eq > "
+ " < FieldRef Name = 'PlantFk_x003a_ID' LookupId='TRUE' /> "
+ " < Value Type = 'number' > " + ParentID + "</ Value >"
+ " </ Eq > "
+ " < Eq > "
+ " < FieldRef Name = 'Flag' /> "
+ " < Value Type = 'Number' > 1 </ Value > "
+ " </ Eq > "
+ " </ And > "
+ " </ Where > "
+ " </Query>";
query.Query = strquery;
Thanks Need Help Plz