Subset search

Hi,

I’m sure this must have been asked before but I’m having trouble finding an equivalent. I’m trying to perform a search within a previous set of search results and I thought from what I’d read, that using the .search(false,true) would do that but it appears not as I’m getting more results than I should following the 2nd search.

What am I doing wrong?

	var lvSearchdate = utils.dateFormat(lvIncFS.calldate,'yyyy-MM-dd HH:mm:ss');
	
	if (lvIncFS.find())
	{
		lvIncFS.calldate='>='+lvSearchdate+'|yyyy-MM-dd HH:mm:ss';
		var lvRecords = lvIncFS.search(true,true);
	} // Endif find
	if (lvRecords != 0)
	{
		if (lvIncFS.find())
		{
			lvIncFS.xferextn='^=';
			lvIncFS.trunkno="102";
			lvRecords = lvIncFS.search(false,true);
		}	
		if (lvRecords != 0)
		{
			
		}
	}

Beside the fact that your search could be done in a single pass the code looks correct. Try to turn tracing on in the admin pages and have a look at the queries fired against the db to see what’s going wrong.

My apologies, the query is working fine. I’ve set-up my test data incorrectly. :oops:

No problem, shit happens… ;)