Buy Now
Sign in

How to select DISTINCT(CONCAT(??? in the 'fields to retrieve' section

NickOg , December 03 2018
NickOg 669
December 03 2018 #381971
Hi
I want to use
DISTINCT(CONCAT(mdlPublishedTerms.intYear,mdlPublishedTerms.txtTerm)):mdlPublishedTerms.publishedTerm
in a db read 'Fields to retrieve' section.
Or better still in select only records where CONCAT(mdlPublishedTerms.intYear,mdlPublishedTerms.txtTerm) is distinct
Any suggestions gratefully received.
Regards
Nick
healyhatman 4.4
December 03 2018 #381972
 Answer
Spaces between the elements.
DISTINCT( CONCAT( mdlPublishedTerms.intYear , mdlPublishedTerms.txtTerm)):mdlPublishedTerms.publishedTerm
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
NickOg 669
December 03 2018 #381973
Ye gods! That easy! Many thanks. My question is - how did you know that? Is there some general rule that I am missing??
Regards
Nick
healyhatman 4.4
December 03 2018 #381974
from a glance at a forum post a year ago.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
NickOg 669
December 07 2018 #382045
Pushing a bit further - how can I set up WHERE to seelct records with the same id as a previous read??
mdlConvenersInfo.id/IN: ( {var:read_data96.mdlConveners})
That mdlConveners looks like this
[array] 0 [array] mdlConveners [string] user_id = "587" [array] 1 [array] mdlConveners [string] user_id = "600" [array] 2 [array] mdlConveners [string] user_id = "605"
    I have a feeling that mdlConveners is wrong for the purpose.
    Regards
    Nick
    healyhatman 4.4
    December 07 2018 #382046
    mdlConvenersInfo.id/IN:{var:read_data96.model.field}
    Should do it
    Web developer at SkySpider.com.au
    I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

    You can now copy+paste code from forums