{"id":6438,"date":"2016-09-16T13:36:16","date_gmt":"2016-09-16T13:36:16","guid":{"rendered":"https:\/\/learning.pcrecruiter.net\/?p=6438"},"modified":"2024-01-12T16:49:12","modified_gmt":"2024-01-12T16:49:12","password":"","slug":"sql-queries","status":"publish","type":"docs","link":"https:\/\/learning.pcrecruiter.net\/site\/docs\/searching\/sql-queries\/","title":{"rendered":"Common MyPCR Search Queries"},"content":{"rendered":"\n<p>The following search queries can be used in the MyPCR Screen&#8217;s Search Links area. Many of these queries can also be applied within the <a href=\"https:\/\/learning.pcrecruiter.net\/site\/docs\/searching\/advanced-search\/\" data-type=\"docs\" data-id=\"5538\">Advanced Search<\/a> screens, but may require modification. <\/p>\n\n\n\n<p><em>Note: The [LE], [GE], #[[-1 days]]# etc. methods are specific to the MyPCR screen and are not standard SQL search terminology. Date-range searches in other screens typically require a specific m\/d\/yyyy start and end.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Company SQL Search Statements<\/h2>\n\n\n\n<p><strong>Find companies entered in the last 7 days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.Company_id IN (SELECT Company_Id FROM company_activity WHERE Date_Entered &#91;GE] #&#91;&#91;-7days]]# AND act_type = 'ADDCOM')<\/code><\/pre>\n\n\n\n<p><strong>Find companies with an Activity written in the last 7 days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.Company_id IN (SELECT Company_Id FROM company_activity WHERE Last_Activity &#91;GE] #&#91;&#91;-7days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find companies with no names:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.Company_id NOT IN (SELECT company_id FROM candidates)<\/code><\/pre>\n\n\n\n<p><strong>Find companies specified as &#8216;Client Company&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.DefaultCo = 'X'<\/code><\/pre>\n\n\n\n<p><strong>Find companies specified as &#8216;Client Company&#8217; based on user name:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.DefaultCo = 'X' AND Companies.user_name LIKE 'USERNAMEHERE'<\/code><\/pre>\n\n\n\n<p><strong>Find companies that are not on a rollup:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.Company_Id NOT IN (SELECT Company_Id FROM RollupC_Records)<\/code><\/pre>\n\n\n\n<p><strong>Find companies with no positions:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.company_id NOT IN (SELECT company_id FROM positions)<\/code><\/pre>\n\n\n\n<p><strong>Find companies based on username of positions:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.company_id IN (SELECT company_ID FROM positions WHERE user_name = 'USERNAMEHERE')<\/code><\/pre>\n\n\n\n<p><strong>Find companies entered since &#8216;date&#8217; that do not have keywords:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.Keyword_Text IS NULL AND Companies.Company_id IN (SELECT company_Id FROM company_activity WHERE Date_Entered &gt;= '9\/1\/2012' AND act_type = 'ADDCOM')<\/code><\/pre>\n\n\n\n<p><strong>Find companies entered since &#8216;date&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.Company_id IN (SELECT Company_Id FROM company_activity WHERE Date_Entered &gt;= '11\/1\/2007' AND act_type = 'ADDCOM')<\/code><\/pre>\n\n\n\n<p><strong>Companies entered by &#8216;xxx&#8217; user in the past &#8216;x&#8217; days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.company_id IN (SELECT company_id FROM company_activity WHERE date_entered &#91;GE] #&#91;&#91;-x day]]# AND act_type = 'ADDCOM') AND user_name = 'xxx'<\/code><\/pre>\n\n\n\n<p><strong>Find companies with an Activity written since &#8216;date&#8217;<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.Company_id IN (SELECT Company_Id FROM company_activity WHERE Last_Activity &gt;= '11\/1\/2007')<\/code><\/pre>\n\n\n\n<p><strong>Find companies with Associations:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.Company_id IN (SELECT company_id FROM Competitors WHERE Description IS NOT NULL)<\/code><\/pre>\n\n\n\n<p><strong>Find companies with Associations that have a specific description (replace the XXXXX with the description):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.Company_id IN (SELECT company_id FROM Competitors WHERE Description = 'XXXXXX')<\/code><\/pre>\n\n\n\n<p><strong>Find companies with interview records based on written by AND interview status:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Companies.Company_id IN (SELECT Company_Id FROM sendout_records WHERE feerange_text = 'Face 1' OR feerange_text = 'Tel 1' AND written_by = 'ADMIN')<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Name SQL Search Statements<\/h2>\n\n\n\n<p><strong>Find all names entered today (all users):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.date_entered &#91;GE] #&#91;&#91;-1 days]]#<\/code><\/pre>\n\n\n\n<p><strong>Find new Candidates entered this week:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(Candidates.Specialty_2 LIKE 'c%') AND Date_entered &#91;GE] #&#91;&#91;-7 days]]#<\/code><\/pre>\n\n\n\n<p><strong>Find all names entered in past X days AND a specific value in a custom field:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM candidate_activity WHERE entry_date &#91;GE] #&#91;&#91;-90 days]]#) AND candidates.candidate_id IN (SELECT candidate_id FROM candidate_fields WHERE Fname = 'XXX' AND Ftext LIKE 'XXX%')<\/code><\/pre>\n\n\n\n<p><strong>Find all names entered today with the status of &#8216;candidate&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.date_entered &#91;GE] #&#91;&#91;-1 days]]# AND Specialty_2 = 'C'<\/code><\/pre>\n\n\n\n<p><strong>Find all names entered today with the status of &#8216;hiring authority&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.date_entered &#91;GE] #&#91;&#91;-1 days]]# AND Specialty_2 = 'H'<\/code><\/pre>\n\n\n\n<p><strong>Find all names UPDATED by PCR Capture in the past 3 days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM record_archive WHERE candidate_id=record_id AND Archive_Type='CAPTURE' AND date_changed &#91;GE] #&#91;&#91;-3days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find all names WHERE a specific field was UPDATED by PCR Capture in the past 3 days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM record_archive WHERE candidate_id=record_id AND field_name='city' AND Archive_Type='CAPTURE' AND date_changed &#91;GE] #&#91;&#91;-3days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find all names UPDATED by PCR Capture by a specific user in the past 3 days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM record_archive WHERE candidate_id=record_id AND Archive_Type='CAPTURE' AND User_Name='ADMIN' AND date_changed &#91;GE] #&#91;&#91;-3days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find all names created today with the status of &#8216;unverified&#8217; (names created today via the Inhaler):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.date_entered &#91;GE] #&#91;&#91;-1 days]]# AND Specialty_2 = 'U'<\/code><\/pre>\n\n\n\n<p><strong>Find all names with the status of &#8216;unverified&#8217; (names created via the Inhaler to be verified):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.Specialty_2 = 'U'<\/code><\/pre>\n\n\n\n<p><strong>Find all names created today by a specific user with the status of &#8216;unverified&#8217; (names created today via the Inhaler):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.date_entered &#91;GE] #&#91;&#91;-1 days]]# AND Specialty_2 = 'U' AND user_name = 'yourusernamehere'<\/code><\/pre>\n\n\n\n<p><strong>Find all names with your User Name AND the Status of &#8216;unverified&#8217; (names you created via the Inhaler to be verified):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.specialty_2 = 'U' AND user_name = 'yourusernamehere'<\/code><\/pre>\n\n\n\n<p><strong>Find all names with the Status of &#8216;Hiring Authority&#8217; (H) AND associated with a &#8216;Client Company&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.specialty_2 = 'H' AND company_id IN (SELECT company_id FROM Companies WHERE DefaultCo = 'X')<\/code><\/pre>\n\n\n\n<p><strong>Find all names associated with a particular company (i.e. Main Sequence) AND your User Name:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM candidates WHERE company_id IN (SELECT company_id FROM companies WHERE company_name = 'main sequence') AND user_name = 'yourusernamehere')<\/code><\/pre>\n\n\n\n<p><strong>Find all names who have modified their information via web extensions in past 7 days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>candidate_id IN (SELECT candidate_id FROM candidate_activity WHERE act_type = 'SAVENAM' AND user_name ='CANDIDATE' AND memo like 'Name was modified%' AND entry_date &#91;GE] #&#91;&#91;-7days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find all names WHERE the resume has been modified in x days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>candidate_id IN (SELECT candidate_id FROM candidate_activity WHERE Act_type = 'RESUME' AND Entry_Date &#91;GE] #&#91;&#91;-X days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find all names with blinded resumes:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidate_id IN (SELECT candidate_id FROM scripts WHERE script_type = 'blind')<\/code><\/pre>\n\n\n\n<p><strong>Find names with Notes:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>candidate_id IN (SELECT candidate_id FROM candidates WHERE freeform_text is not null)<\/code><\/pre>\n\n\n\n<p><strong>Find records that do not have Keywords:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Keyword_Text IS NULL<\/code><\/pre>\n\n\n\n<p><strong>Find records based on Keywords (Note: Keyword searching FROM the MyPCR screen will be slower than normal):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Keyword_Text like '%engineer%' Finds records with engineer\nKeyword_Text like '%engineer%' AND keyword_text like '%mechanical%' Finds records with engineer AND mechanical.\nkeyword_text like '%mechanical engineer%' Finds records with the phrase 'mechanical engineer'.<\/code><\/pre>\n\n\n\n<p><strong>Find names with a resume:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Resume = 'Y'<\/code><\/pre>\n\n\n\n<p><strong>Find names with no resume:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Resume IS NULL<\/code><\/pre>\n\n\n\n<p><strong>Find names with Associations:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidate_id IN (SELECT company_id FROM Competitors WHERE Description is not null)<\/code><\/pre>\n\n\n\n<p><strong>Find names with Associations that have a specific description (replace the XXXXX with the description):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>candidate_id IN (SELECT company_id FROM Competitors WHERE Description = 'XXXXXX')<\/code><\/pre>\n\n\n\n<p><strong>Find names with profiles:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidate_id IN (SELECT Candidate_Id FROM Scripts WHERE Rollup_Name like 'CAPROFILE%')<\/code><\/pre>\n\n\n\n<p><strong>Find names with profile with &#8216;xx&#8217; name:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidate_id IN (SELECT Candidate_Id FROM Scripts WHERE Rollup_Name = 'CAPROFILE2' AND Description = 'XXX')<\/code><\/pre>\n\n\n\n<p><strong>Find names with attachments:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidate_id IN (SELECT Candidate_Id FROM Scripts WHERE Rollup_Name = 'UPLOAD')<\/code><\/pre>\n\n\n\n<p><strong>Find all names WHERE a new attachment has been added in x days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>candidate_id IN (SELECT candidate_id FROM Scripts WHERE (Rollup_Name = 'UPLOAD' OR rollup_name = 'RTF' OR rollup_name = 'LINK' OR rollup_name = 'HTML'' OR rollup_name = 'PIN' OR rollup_name = 'CAPROFILE2' OR Rollup_name = 'CAPROFILE' AND script_date &#91;GE] #&#91;&#91;-X days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find names with attachment with &#8216;xx&#8217; name:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidate_id IN (SELECT Candidate_Id FROM Scripts WHERE Rollup_Name = 'UPLOAD' AND Description = 'XXX')<\/code><\/pre>\n\n\n\n<p><strong>Find all names WHERE a feedback form has been received in last x days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>candidate_id IN (SELECT candidate_id FROM Scripts WHERE Rollup_Name = 'FEEDBACK' AND script_date &#91;GE] #&#91;&#91;-X days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find all names WHERE there is an activity that has a specific activity type OR result:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>candidate_id IN (SELECT candidate_id FROM candidate_activity WHERE Act_type = 'XXXX')\ncandidate_id IN (SELECT candidate_id FROM candidate_activity WHERE Result = 'XXXX')<\/code><\/pre>\n\n\n\n<p><strong>Find all names based on activity text:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>candidate_id IN (SELECT candidate_id FROM candidate_activity WHERE memo like 'XXX')<\/code><\/pre>\n\n\n\n<p><strong>Find all names WHERE there is an activity of a specific activity type OR result written within X days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>candidate_id IN (SELECT candidate_id FROM candidate_activity WHERE Act_type = 'XXXX' AND Entry_Date&#91;GE] #&#91;&#91;-X days]]#) OR\ncandidate_id IN (SELECT candidate_id FROM candidate_activity WHERE Result = 'XXXX' AND Entry_Date &#91;GE] #&#91;&#91;-X days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find all names on a specific rollup with the status of C (closed):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>candidates.candidate_id IN (SELECT candidate_id FROM rollup_records WHERE rollup_name = 'ADMIN.0001' AND description = 'C')<\/code><\/pre>\n\n\n\n<p><strong>Find all names placed on any Name Rollup in the past 7 days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidate_id IN (SELECT Candidate_Id FROM Rollup_Records WHERE Date_Created &#91;GE] #&#91;&#91;-7days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find all names added to a specific rollup in the past 7 days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidate_id IN (SELECT Candidate_Id FROM Rollup_Records WHERE rollup_name='ADMIN.1234' AND Date_Created &#91;GE] #&#91;&#91;-7days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find all names placed on Rollups designated with category &#8216;xxx&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(Candidates.Candidate_id IN (SELECT Candidate_Id FROM Rollup_Records WHERE Rollup_Name IN (SELECT code FROM rollup_names WHERE Category='XXX')))<\/code><\/pre>\n\n\n\n<p><strong>Find all names not on Rollups:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id NOT IN (SELECT candidate_id FROM rollup_records)<\/code><\/pre>\n\n\n\n<p><strong>Find all names linked to positions:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.Candidate_id IN (SELECT candidate_id FROM sendout_records)<\/code><\/pre>\n\n\n\n<p><strong>Find all names that have been connected to multiple jobs:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.Candidate_id IN (SELECT Candidate_id FROM Sendout_records GROUP BY Candidate_id Having Count(Distinct(job_id)) &gt; 1 )<\/code><\/pre>\n\n\n\n<p><strong>Find all names that have been connected to multiple AVAILABLE jobs:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.Candidate_id IN (SELECT Candidate_id FROM Sendout_records WHERE job_id IN (SELECT job_id FROM positions WHERE status ='A')\nGROUP BY Candidate_id HAVING Count(Distinct(job_id)) &gt; 1 )<\/code><\/pre>\n\n\n\n<p><strong>Find all New names (Current Interview Type = Presentation) in pipelines based on Position User Name:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN ( SELECT candidate_id FROM sendout_records WHERE Current_Stage = 5 AND Job_id IN (SELECT job_id FROM positions WHERE User_Name = 'yourusername))<\/code><\/pre>\n\n\n\n<p><strong>Find names based on current interview status for available positions with a specific company:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE current_status = 'Submitted AND job_id IN (SELECT job_id FROM positions WHERE Status = 'A' AND company_id IN (SELECT company_id FROM companies WHERE company_name ='Main Sequence')))<\/code><\/pre>\n\n\n\n<p><strong>Find all names in the pipeline for an Available\/Open position, except those who are currently at the &#8216;Offer Declined&#8217; OR &#8216;Out of Process&#8217; stage.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE current_stage = 0 OR current_stage = 1 OR current_stage = 2 OR current_stage = 3 OR current_stage = 4 OR current_stage = 5 OR current_stage = 7 OR current_stage = 8 OR current_stage = 9 AND Job_id IN (SELECT job_id FROM positions WHERE Status = 'A'))<\/code><\/pre>\n\n\n\n<p><strong>Find all names not linked to positions:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id NOT IN (SELECT candidate_id FROM sendout_records)<\/code><\/pre>\n\n\n\n<p><strong>Find all names linked to positions of a specific user:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE job_id IN (SELECT Job_id FROM positions WHERE User_Name = 'usernamehere'))<\/code><\/pre>\n\n\n\n<p><strong>Find all names linked to a position of a specific title:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE job_id IN (SELECT Job_id FROM positions WHERE Job_title = 'MANAGER'))<\/code><\/pre>\n\n\n\n<p><strong>Find all New names in all pipelines:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE current_status = 'LINKNAME' OR current_status = 'On-Line Job Inquiry' AND interview_type = 5)<\/code><\/pre>\n\n\n\n<p><strong>Find all names with the current interview status of &#8216;On-line Job Inquiry&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE current_status = 'On-Line Job Inquiry')<\/code><\/pre>\n\n\n\n<p><strong>Find all names with the current interview status of &#8216;On-line Job Inquiry&#8217; for Available\/Open positions:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE current_status = 'On-Line Job Inquiry' AND Job_id IN (SELECT job_id FROM positions WHERE Status = 'A'))<\/code><\/pre>\n\n\n\n<p><strong>Find all names with an &#8216;On-line Job Inquiry&#8217; sendout record created in the past day:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE arranged_date &#91;GE] #&#91;&#91;-1 days]]# AND arranged_date &#91;LE] #&#91;&#91;NOW]]# AND Feerange_Text = 'On-Line Job Inquiry')<\/code><\/pre>\n\n\n\n<p><strong>Find all names linked to a specific job ID WHERE with the current interview status of &#8216;On-Line Job Inquiry&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE current_status = 'On-Line Job Inquiry' AND Job_id IN (SELECT job_id FROM positions WHERE Position_ID = '13'))<\/code><\/pre>\n\n\n\n<p><strong>Find all names in pipelines WHERE the Position Status is &#8216;Available&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE job_id IN (SELECT job_id FROM positions WHERE status like 'A'))<\/code><\/pre>\n\n\n\n<p><strong>Find all names with an interview written by user &#8216;xxx&#8217; AND arranged date is in past &#8216;x&#8217; days :<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE arranged_date &#91;GE] #&#91;&#91;-x days]]# AND arranged_date &#91;LE] #&#91;&#91;NOW]]# AND Written_By = 'xxx')<\/code><\/pre>\n\n\n\n<p><strong>Find all names with a Telephone OR InPerson Interviews scheduled for next 7 days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE appointment_date &#91;GE] #&#91;&#91;NOW]]# AND appointment_date &#91;LE] #&#91;&#91;7 days]]# AND Written_By = 'admin' AND (Interview_Type = '1' OR Interview_Type = '2'))<\/code><\/pre>\n\n\n\n<p><strong>Find all names with an interview written by user &#8216;xxx&#8217; AND appointment date is in past &#8216;x&#8217; days :<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE appointment_date &#91;GE] #&#91;&#91;-x days]]# AND appointment_date &#91;LE] #&#91;&#91;NOW]]# AND Written_By = 'xxx')<\/code><\/pre>\n\n\n\n<p><strong>Find all names currently at the Offer Stage, Offer Made OR Offer Accepted stage WHERE the Position Status is &#8216;Available\/Open:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE current_stage = 7 OR current_stage = 8 OR current_stage = 9 AND Job_id IN (SELECT job_id FROM positions WHERE Status = 'A'))<\/code><\/pre>\n\n\n\n<p><strong>Find all permanent hires placed by &#8216;xxx&#8217; AND placement date in past &#8216;x&#8217; days :<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE arranged_date &#91;GE] #&#91;&#91;-x days]]# AND arranged_date &#91;LE] #&#91;&#91;NOW]]# AND Written_By = 'xxx' AND Interview_Type = '4')<\/code><\/pre>\n\n\n\n<p><strong>Find all contractors placed by &#8216;admin&#8217; with contract end date in the next 30 days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE end_date &#91;GE] #&#91;&#91;NOW]]# AND end_date &#91;LE] #&#91;&#91;30 days]]# AND Written_By = 'admin' AND Interview_Type = '0')<\/code><\/pre>\n\n\n\n<p><strong>Find all permanent hires placed by &#8216;xxx&#8217; AND start date in past &#8216;x&#8217; days :<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.candidate_id IN (SELECT candidate_id FROM sendout_records WHERE appointment_date &#91;GE] #&#91;&#91;-x days]]# AND appointment_date &#91;LE] #&#91;&#91;NOW]]# AND Written_By = 'xxx' AND Interview_Type = '4')<\/code><\/pre>\n\n\n\n<p><strong>Find all names previously placed on a contract assignment WHERE the end date has expired, AND not currently on an assignment.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.specialty_2 NOT LIKE 'a' AND candidate_id IN (SELECT candidate_id FROM sendout_records WHERE end_date &#91;LE] #&#91;&#91;NOW]]# AND Interview_Type = '0')<\/code><\/pre>\n\n\n\n<p><strong>Find names with specific email addresses in Custom Email Fields:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Candidates.Candidate_id IN (SELECT Candidate_id FROM candidate_fields WHERE Ftext IN ('email address','second email address))<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Position SQL Search Statements<\/h2>\n\n\n\n<p><strong>Find all positions entered by &#8216;xxx&#8217; user in the past &#8216;x&#8217; days:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.job_id IN (SELECT job_id WHERE Datediff(dd,convert(datetime,Date_Posted,101),convert(datetime,GETDATE(),101))&lt;30) AND User_Name = 'XXX'<\/code><\/pre>\n\n\n\n<p><strong>Find all positions entered today (all users):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.job_id IN (SELECT job_id FROM positions WHERE date_posted &#91;GE] #&#91;&#91;-1 days]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find all available positions (all users):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.Status = 'A'<\/code><\/pre>\n\n\n\n<p><strong>Find all pending positions (all users):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.Status = 'P'<\/code><\/pre>\n\n\n\n<p><strong>Find all positions posted via web extensions (employers) with the status of Pending:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.Status = 'P' AND user_Name = 'EMPLOYER'<\/code><\/pre>\n\n\n\n<p><strong>Find all positions showing in candidate web extensions (Status=Available AND Show On Web=Show):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.Status = 'A' AND Web = '0'<\/code><\/pre>\n\n\n\n<p><strong>Find all positions posted today via web extensions (employers):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.job_id IN (SELECT job_id FROM positions WHERE user_name like 'employer' AND date_posted &#91;GE] #&#91;&#91;-1 day]]#)<\/code><\/pre>\n\n\n\n<p><strong>Find the 10 most recent positions (all users):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.Job_id IN (SELECT TOP 10 po.Job_Id FROM Positions po ORDER BY po.Date_Posted Desc)<\/code><\/pre>\n\n\n\n<p><strong>Find all positions open for over 30 days (all users):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.job_id IN (SELECT job_id FROM positions WHERE date_posted &#91;LE] #&#91;&#91;-30 days]]# AND status = 'A')<\/code><\/pre>\n\n\n\n<p><strong>Find all positions opened in the past 3 days (all users):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.job_id IN (SELECT job_id FROM positions WHERE date_posted &#91;GE] #&#91;&#91;-3 days]]# AND status = 'A')<\/code><\/pre>\n\n\n\n<p><strong>Find Available\/Open positions that currently have Telephone OR In-Person interview records:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.job_id IN (SELECT job_id FROM sendout_records WHERE current_stage = '1' OR current_stage = '2') AND status = 'A'<\/code><\/pre>\n\n\n\n<p><strong>Find Available\/Open positions that currently do not have Telephone OR In-Person interview records:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.job_id NOT IN (SELECT job_id FROM sendout_records WHERE current_stage = '1' OR current_stage = '2') AND status = 'A'<\/code><\/pre>\n\n\n\n<p><strong>Find Available\/Open positions that do not have an interview record with the interview type of &#8216;Resume&#8217;:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.job_id not in (SELECT job_id FROM sendout_records WHERE interview_type = '3') AND status='A'<\/code><\/pre>\n\n\n\n<p><strong>Find positions based on user name that an employer has edited via the web extensions in the past day. (Replace admin with the correct user name.)<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Positions.user_name = 'admin' AND job_id IN (SELECT position_id FROM Position_Activities WHERE user_name = 'employer' AND act_type = 'savepos' AND Date_Entered &#91;GE] #&#91;&#91;-1 days]]#)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The following search queries can be used in the MyPCR Screen&#8217;s Search Links area. Many of these queries can also be applied within the Advanced Search screens, but may require modification. Note: The [LE], [GE], #[[-1 days]]# etc. methods are specific to the MyPCR screen and are not standard SQL search terminology. Date-range searches in&hellip; <a class=\"more-link\" href=\"https:\/\/learning.pcrecruiter.net\/site\/docs\/searching\/sql-queries\/\">Continue reading <span class=\"screen-reader-text\">Common MyPCR Search Queries<\/span><\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"pcr-menu-id":[],"footnotes":""},"doc_category":[33],"doc_tag":[],"knowledge_base":[25],"class_list":["post-6438","docs","type-docs","status-publish","hentry","doc_category-searching","knowledge_base-nine","entry"],"year_month":"2026-04","word_count":2865,"total_views":"1715","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"PCRecruiter","author_nicename":"arothman","author_url":"https:\/\/learning.pcrecruiter.net\/site\/author\/arothman\/"},"doc_category_info":[{"term_name":"Searching","term_url":"https:\/\/learning.pcrecruiter.net\/site\/docs\/nine\/searching\/"}],"doc_tag_info":[],"knowledge_base_info":[{"term_name":"PCRecruiter 9","term_url":"https:\/\/learning.pcrecruiter.net\/site\/docs\/nine\/","term_slug":"nine"}],"knowledge_base_slug":["nine"],"_links":{"self":[{"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/docs\/6438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/comments?post=6438"}],"version-history":[{"count":7,"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/docs\/6438\/revisions"}],"predecessor-version":[{"id":12210,"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/docs\/6438\/revisions\/12210"}],"wp:attachment":[{"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/media?parent=6438"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/doc_category?post=6438"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/doc_tag?post=6438"},{"taxonomy":"knowledge_base","embeddable":true,"href":"https:\/\/learning.pcrecruiter.net\/site\/wp-json\/wp\/v2\/knowledge_base?post=6438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}