Hi @Rick Murray
This works for me (MS SQL):
SELECT
oh_name,
STRING_AGG(OCA.OCA_VALUE, ', ') AS concatenated_values
FROM
oh
JOIN
OCA ON OCA.oca_oh_idnr = oh.oh_idnr
WHERE
OCA.OCA_VALUE IS NOT NULL
AND oh.OH_otype = 'JOBS'
AND oh.oh_client = '1000'
GROUP BY
oh.oh_name;

Cheers
Christoph
------------------------------
----------------------------------------------------------------
Automic AE Consultant and Trainer since 2000
----------------------------------------------------------------
------------------------------
Original Message:
Sent: Dec 21, 2023 01:45 PM
From: Rick Murray
Subject: SQL for all JOBS objects, that also lists the Custom Attributes that are set
Yes, it is time for what appears to be my "Weekly SQL question"
I am in the process of setting up a Custom Attribute that contains the Department assigned to JOBS. So far, that is working fine.
The next step is being able to report all of our JOBS objects, and include the Custom Attribute. That is where I am stuck
I used the listing of table to locate any table associated with "attribute", then I searched each table, but wasn't able to locate the following

My eventual goal is to include the Custom Attribute info in the following, so I can create a list of the JOBS and what department is the business owner
SELECT OH_CLIENT, OH_NAME, OH_TITLE, OH_CRDATE, OH_LASTDATE, OH_LASTCNT
FROM OH
WHERE OH.OH_CLIENT = '99'
AND OH.OH_DELETEFLAG = '0'
AND OH.OH_OTYPE = 'JOBS'
Anyone know what table this info should be in?
Also, any chance someone already has the sql created?
Thanks in advance
Rick