<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I am using a 3<sup>rd</sup> party BI tool for some auditing tools here, and am trying to understand the table layout.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As part of the project I would like to list for a ticket the<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ticket number, creator, creator phone number, created date, ….the queue, the business unit, and other data.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have figured out how to join the data from tickets, queues, and users tables, but I am not getting very far on the custom fields.   In my example above,  I have a custom field “Business Unit” and it has several different potential values.   
 Can anyone suggest how I might add that to my query?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Currently I have:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">select Tickets.id, Tickets.Status, Tickets.Subject, <o:p></o:p></p>
<p class="MsoNormal">Tickets.Created,tickets_creator_user.Name as "Creator", <o:p>
</o:p></p>
<p class="MsoNormal">Tickets.Started,tickets_owner_users.Name as "Owner", <o:p></o:p></p>
<p class="MsoNormal">Tickets.Resolved,  tickets_lastupdateby_users.Name as "Last Update By",<o:p></o:p></p>
<p class="MsoNormal">Queues.Name as "Queue"<o:p></o:p></p>
<p class="MsoNormal">from Tickets,<o:p></o:p></p>
<p class="MsoNormal">Users tickets_creator_user,<o:p></o:p></p>
<p class="MsoNormal">Users tickets_owner_users,<o:p></o:p></p>
<p class="MsoNormal">Users tickets_lastupdateby_users,<o:p></o:p></p>
<p class="MsoNormal">Queues<o:p></o:p></p>
<p class="MsoNormal">where Queues.id = Tickets.Queue and<o:p></o:p></p>
<p class="MsoNormal">Tickets.Creator = tickets_creator_user.id and<o:p></o:p></p>
<p class="MsoNormal">Tickets.Owner = tickets_owner_users.id and<o:p></o:p></p>
<p class="MsoNormal">Tickets.LastUpdatedBy = tickets_lastupdateby_users.id;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Scott<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<font face="monospace">------------------------------------------------------------------------------------<br>
This e-mail message is intended only for the personal use of the recipient(s) named above. If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the Hearst Service Center (cadmin@hearstsc.com) immediately by email and delete the original message.<br>
------------------------------------------------------------------------------------</font></body>
</html>