Question

I need a little assistance regarding to RETS. I have not worked in it before. I am stuck at a point.

Here is the code

$rets_modtimestamp_field = "LastTr_260";
$previous_start_time = "2013-01-01T00:00:00";
$listing_status = "Status_383";
$listing_price = "ListPr_276";

The original query that I got was

$query = "({$rets_modtimestamp_field}={$previous_start_time}+)";

I had to update the query to add listing status and listing price. I searched around over the internet and updated the query to this.

$query = "(ListPrice=ListPr_276),(ModificationTimestamp=LastTr_260),(ListingStatus=Status_383),(".$previous_start_time."+)";

This is where the query is being used..

$search = $rets->SearchQuery("Property", $class, $query, array('Limit' => 1000));

Any ideas why the query is returning no results? I feel there is something in reference to start time...I have no idea about it...

Any help would be highly appreciated.

Thanks and Cheers

Ahmad

No correct solution

OTHER TIPS

The last condition in your query is missing the name in the name=value pair. So your query would translate to:

$query = "(ListPrice=ListPr_276),(ModificationTimestamp=LastTr_260),(ListingStatus=Status_383),(2013-01-01T00:00:00+)";

With the name-value pair:

$query = "(ListPrice=ListPr_276),(ModificationTimestamp=LastTr_260),(ListingStatus=Status_383),({$rets_modtimestamp_field}={$previous_start_time}+)";

These look like the type of RETS field names that come from Interealty - one of the major RETS vendors. There are five variations of RETS field names - the "SystemName", "StandardName", "LongName", "ShortName", and "DBName." You appear to be querying on the DBName, which usually is not queryable. Try the SystemName, which should always be queryable. Interealty uses numeric SystemNames, so your list price field, ListPr_176, would very likely have the SystemName "176". The part of the query for the price would then look more like "(176=0+)". The entire query code should probably look more like this:

$rets_modtimestamp_field = "260";
$previous_start_time = "2013-01-01T00:00:00";
$listing_status = "383";
$listing_price = "276";  

$query = "(".$listing_price."=0+),(".$listing_status."=|A),(".$rets_modtimestamp_field."=".$previous_start_time."+)";

(I added a presumed lookup value for Listing Status of active)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top