Can you have a DMQL search query with an OR statement??

1,547 views
Skip to first unread message

Gifford Boake

unread,
Aug 20, 2014, 1:44:30 PM8/20/14
to phr...@googlegroups.com
Hey Guys,

The RETS I am working with has two updated time stamps, one is Timestamp_sql and one i Idx_dt.

For incremental updates to my db my board suggests that your search query for any listings updated in the last 10days or so you should use a search condition in your query that checks both Timestamp_sql and Idx_dt. In their documentation they say to use the SQL equivalent of an OR statement in your RETS client. 

Since I am using PHRETS I dont have an actual GUI RETS client I am unsure how to do this in a single query. When you use multiple search conditions (ie. ('Timestamp_sql = 2014--08-10 +'), ('Idx_dt = 2014-08-10+')) it acts like an AND statement. This is a problem as the IDX_dt field usually has very old dates even though Timestamp_sql has been updated in the last few days.

Is there any way to complete a DMQL search query with the equivalent of an OR statement?

Cheers,

Giff

Matrix Marketers

unread,
Aug 20, 2014, 1:54:48 PM8/20/14
to phr...@googlegroups.com
Try using | instead of ,

Gifford Boake

unread,
Aug 20, 2014, 2:09:20 PM8/20/14
to phr...@googlegroups.com
I was hoping it would be this easy but didnt work unfortunately. I do have other search conditions as well so i trued wrapping the (Timesatmp_sql) | (Idx_dt) condition in an extra set of parenthesis but still no luck.

Have you been able to get the | operator to work??

Thanks Again.

Prop Apps

unread,
Aug 20, 2014, 2:14:01 PM8/20/14
to phr...@googlegroups.com
Hey Giff!

The | should work under normal circumstances, can you please paste your search query here.

The Prop Apps Team
Marketing Tools for Realtors
https://www.propapps.com


On Wednesday, August 20, 2014 11:14:30 PM UTC+5:30, Gifford Boake wrote:

Matrix Marketers

unread,
Aug 20, 2014, 2:23:00 PM8/20/14
to phr...@googlegroups.com
RETS specifications say that this operator should work. But well, most of the RETS implementations are not done correctly. Can you please paste the search query here.

Matrix Marketers

unread,
Aug 20, 2014, 2:28:44 PM8/20/14
to phr...@googlegroups.com
I just tried $query = "(LISTDATE=2014-08-19)|(YEARBUILT=2014)"; on HAR and worked fine.

You might want to try nesting them as:

$query = "((LISTDATE=2014-08-19)|(YEARBUILT=2014)),(COUNTY=county_name)";

Please let me know if this works!


On Wednesday, August 20, 2014 11:14:30 PM UTC+5:30, Gifford Boake wrote:

Gifford Boake

unread,
Aug 20, 2014, 2:31:53 PM8/20/14
to phr...@googlegroups.com
Yes I have been finding that out the hard way the last few days!
Here is what I have:

$search = $rets->SearchQuery(
"Property",
"ResidentialProperty",
"((Status=A),(Area_code=04),(Timestamp_sql=2014-08-19+) | (Idx_dt=2014-08-19+) )", 

array(
'Format' => 'COMPACT-DECODED',
'Select' => 'Ml_num,Timestamp_sql,Idx_dt',
'Count' => 1,
)
);


I have also tried: 


"((Status=A),(Area_code=04), ((Timestamp_sql=2014-08-19+) | (Idx_dt=2014-08-19+)) )",

and

"((Status=A),(Area_code=04),(Timestamp_sql | Idx_dt =2014-08-19+) )",


If i just check for Timestamp_sql then i get about 60 records returned. When i search only with Idx_dt  i get 0 records returned. And when i search with both of them I get 0 results as well. So it seems no matter what I do it always acts as an AND.

Matrix Marketers

unread,
Aug 20, 2014, 2:36:15 PM8/20/14
to phr...@googlegroups.com
Can you try this and see if it returns anything. If the operator works, we can look at other combinations of using it in the query.


$search = $rets->SearchQuery(
        "Property",
        "ResidentialProperty",
        "(Timestamp_sql=2014-08-19+)|(Idx_dt=2014-08-19+)",

        array(
            'Format'    => 'COMPACT-DECODED',
            'Select'    => 'Ml_num,Timestamp_sql,Idx_dt',
            'Count'    => 1,
        )
    );

On Wednesday, August 20, 2014 11:14:30 PM UTC+5:30, Gifford Boake wrote:

Gifford Boake

unread,
Aug 20, 2014, 2:45:23 PM8/20/14
to phr...@googlegroups.com
Hey Thanks for all your help.

Still not working though, I have tried without nesting and with nesting. I have also tried having the two conditions with the OR statement at the front as you have it.

Could there be some other character that my RETS might use instead of   | 

Gifford Boake

unread,
Aug 20, 2014, 2:47:59 PM8/20/14
to phr...@googlegroups.com
Tried using only the one condition

(Timestamp_sql=2014-08-19+)|(Idx_dt=2014-08-19+)

but still no luck. Is it possible that some RETS just dont support OR statements? That would be kind of weird though as i thought all RETS just use the DMQL query language?

W Bowley

unread,
Aug 22, 2014, 8:56:54 AM8/22/14
to phr...@googlegroups.com
When you use only the Timestamp_sql value in your search, what are the values in the Idx_dt column for those fields? 


--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.
To post to this group, send email to phr...@googlegroups.com.
Visit this group at http://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

Gleb Nazarkin

unread,
Sep 23, 2017, 7:29:43 PM9/23/17
to PHRETS
Hey any luck getting it to work? I'm struggling with the exact same problem right now
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages