Combine ServiceNow Table: asmt_metric_result and asmt_assessment_instance

jancaasi
Mega Expert

Hi Guys,

Happy Holidays!

I would like to seek your assistance in helping me combine the two mentioned tables.

  • asmt_metric_result
  • asmt_assessment_instance

The WHERE clause that I'm using is ai_number   = mr_instance. There's no error in this WHERE clause however, it is returning 0 result even though there's data in both tables. I've checked and confirmed this manually. Can anyone assist me on this?

The reason why I need to combine both of these tables is because I need to combine another table called Task [task]. I'm planning to combine the task and asmt_assessment_instance tables using Trigger ID and Number fields (Hopefully it works) so that I can also extract the Assignment Group field of our CSAT Survey.

Regards,

Jan Raphael Caasi

1 ACCEPTED SOLUTION

drjohnchun
Tera Guru

I confirm that you need to join on



asmt_assessment_instance.sys_id = asmt_metric_result.instance



This is the same as what Sumanta suggested.



Hope this helps.



Please feel free to connect, follow, mark helpful / answer, like, endorse.


John Chun, PhD PMP see John's LinkedIn profile

visit snowaid


ServiceNow Advocate

Winner of November 2016 Members' Choice Award


View solution in original post

3 REPLIES 3

Sumanta Sathua
ServiceNow Employee
ServiceNow Employee

I just tried the following query and got the result.



SELECT * from asmt_assessment_instance t1 INNER JOIN   asmt_metric_result   t2 where t1.sys_id=t2.instance



Can you please paste the full column name   with the query   here ?



Thanks


drjohnchun
Tera Guru

I confirm that you need to join on



asmt_assessment_instance.sys_id = asmt_metric_result.instance



This is the same as what Sumanta suggested.



Hope this helps.



Please feel free to connect, follow, mark helpful / answer, like, endorse.


John Chun, PhD PMP see John's LinkedIn profile

visit snowaid


ServiceNow Advocate

Winner of November 2016 Members' Choice Award


jancaasi
Mega Expert

Thanks John Chun 🙂