Forum Discussion
Hi VarunGrazitti,
Thanks !!!
Now, I am able to fetch the results and sort by views using given query.
SELECT * FROM messages WHERE category.id IN ('CATEGORY_ID') AND is_solution = true ORDER BY metrics.views DESC LIMIT 6
To use date range, i tried this:
SELECT * FROM messages WHERE category.id IN ('CATEGORY_ID') AND conversation.last_post_time > 2015-03-16T10:04:30-08:00
AND conversation.last_post_time < 2015-07-16T10:04:30-08:00 AND depth=0 AND is_solution = true ORDER BY metrics.views DESC LIMIT 6
But unable to get the required respose, because when we say is_solution = true then we can't satisfy the codition depth=0.
So how to use date range in above query.
Regards,
Vishwajeet.
See an idea here - https://community.lithium.com/t5/Product-Ideas/API-2-0-Be-able-to-use-custom-tags-as-a-constraint-for-messages/idc-p/189373#M8321
Another way could be (workaround) that in your code, you can skip the threads which have date > 30 days before today. I hope this helps.
- vishwajeet_hol10 years agoExpert
VarunGrazitti Thanks for information !!!
- irach158 years agoMaven
Hi VarunGrazitti,
2 years ago ;-), was you able to implement it?
I need something similar, latest 5-7 solutions fro a specific board, sorted by acceptance date.
And show subject, some body content and acceptance date.
Any code samples appreciated.