Filtering Job on Hold in Queries

2918
1
04-23-2010 08:41 AM
AndrewRudin
Occasional Contributor III
Now that we are starting to put jobs on hold, I need to filter those jobs with active holds out of some of the queries I have in JTX.  Something like an "Active jobs that aren't on hold" query.  From what I can see in the tables, the only way to query if a job is on hold is to check the JOB_HOLDS table and see if that job as any hold records with no RELEASE_DATE value.  Am I right?  Something like this?

Select * FROM JTX_ADMIN.JOBS_HOLDS WHERE JOB_ID = <jobid> and RELEASE_DATE is NULL

My SQL expertise is pretty limited, so the query above just returns a list of related records from another table.  How do I filter a job from my JTX window if it has related records(that have a RELEASE_DATE of NULL) in another table

Here's my existing WHERE clause for my "Jobs Ready to Edit" Query:

WHERE JTX_ADMIN.JTX_JOBS.STATUS = JTX_ADMIN.JTX_STATUS.ID AND JTX_ADMIN.JTX_STATUS.NAME = 'Edit Queue'

Or is there a better way?
Also, I'm in JTX 9.3.1

Thanks for any help!

-Andrew
0 Kudos
1 Reply
TopeBello
Occasional Contributor III
Hi Andrew,

The only way to currently get jobs with active holds via queries is to query for records where release date is null like you have. Alternatively, you can write a custom command that uses the JTX API to retrieve that information off a job.

Thanks,
Tope
0 Kudos