Skip to Content

SQL query - getting data from other tables

Hi, I am creating a new query to see all open service calls for a particular user. I'm using the oscl table. But rather than displaying a number for the 'status' or 'handled by' field, it is possible to display the actual name for each of these values instead in the results.

SELECT T0.[callID], T0.[status], T0.[subject], T0.[customer], T0.[custmrName], T0.[assignee], T0.[descrption] FROM OSCL T0 WHERE T0.[assignee] = 11 and T0.[status] != -1 ORDER BY T0.[createDate] desc

Thanks, Eoin

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jul 26, 2017 at 04:49 PM

    From doing more research I have found the answer I needed. Putting this here in case it helps anyone else.

    This will list all open calls in a query & show the Status description & the user name instead of the numbers on the results displayed.

    SELECT T0.[callID], T1.[NAME], T0.[subject], T0.[customer], T0.[custmrName], T2.[USER_CODE], T0.[descrption] FROM OSCL T0 inner join OSCS T1 on t0.[status] = T1.[statusid] inner join ousr T2 on T0.assignee=T2.uSERID WHERE T0.[assignee] = 11 and T0.[status] != -1 ORDER BY T0.[createDate] asc

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Eoin,

      Thank you for sharing your solution. Too few people do that when they figure it out themselves.

      Please mark your answer as best answer, and then close the thread, so if anyone sees this post come up in a search, they will know right away that it contains a solution.

      Regards,

      Johan