[SOLVED] CB Query Field: Country. Need help to make it filter by Country instead of iso

4 years 3 months ago #316217 by krileon
The Advanced sorting just directly adds whatever you supply to the ORDER BY clause of the userlist query. You will have to provide that SQL yourself. See the below SQL documentation regarding SQL structure.

dev.mysql.com/doc/refman/5.7/en/select.html


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

4 years 2 months ago #316670 by danpoole
Hello Again.

I have tried multiple times to try and work out how to get the SQL to work, I keep getting a 1064 Syntax Error and I think it is because I don't understand how to reference country when calling the country info field or that I'm not correctly calling the country info field. I originally thought it might of been due to the version of Query Field, so I resubscribed to the 3 month Professional and updated the Query Field plugin to the latest version. Can I please be shown the correct format in which to write the advanced query for the user list.

Please Log in to join the conversation.

4 years 2 months ago #316685 by krileon
You'll need a subquery in the Advanced sorting functionality that converts the ISO to the country name. Example as follows.

( SELECT c.`country` FROM `#__country_info` AS c WHERE c.`iso` = ue.`cb_country` ) ASC


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: danpoole

Please Log in to join the conversation.

4 years 2 months ago #316711 by danpoole
Thank you for the example, The advance sorting is now working, My issues turns out that I didn't understand how to use the ue properly. Sorry for taking your time and again thank you for the help.
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.224 seconds

Facebook Twitter LinkedIn