Report Builder display label

By daniel - September 27, 2019

Hi Tim,

Those ":label" fields are specially generated by the getRecords() function, so it's not quite so simple to get it from a straight MySQL query. Since you're using a field called "agentsNum" I assume it's being populated from an "agents" table, which is good as it means that we can use a JOIN to get the label. That would look something like this:

<?php echo $TABLE_PREFIX ?>agents.label as 'Agent',
nlb_subscribersNum as 'Contact',
DATE_FORMAT(<?php echo $TABLE_PREFIX ?>notes.updatedDate, '%M %Y') as 'Date'
FROM <?php echo $TABLE_PREFIX ?>notes
LEFT JOIN <?php echo $TABLE_PREFIX ?>agents ON <?php echo $TABLE_PREFIX ?>notes.agentsNum = <?php echo $TABLE_PREFIX ?>agents.num
ORDER BY Contact

"agents" will need to match your actual Agents table name, and ".label" and ".num" will need to match their respective fields in the Agents table. You can read more about JOIN statements here:

Let me know if that does the trick, or if you have any other questions.


PHP Programmer

By Toledoh - September 27, 2019

Perfect - thanks Daniel.

Tim (