<p>If everything works as expected then ticket's time worked field should hold correct sum. This value you can display in search results without custom code.</p>
<p>Regards, Ruslan. From phone.</p>
<div class="gmail_quote">08.08.2011 22:39 пользователь "Scott Benson" <<a href="mailto:sbenson@a-1networks.com">sbenson@a-1networks.com</a>> написал:<br type="attribution">> Thanks for the reply Gerard.  Not sure what ColumnMap is, but basically <br>
> what we're looking to do is only list tickets in a "custom search" that <br>> have had time worked, within a certain time frame.  Also showing the <br>> Sum(Transactions.TimeWorked) as a field.<br>
> <br>> This can be accomplished via Mysql because you can join databases and <br>> select data on a per transaction level.<br>> <br>> Example Mysql Code:<br>> select Tickets.EffectiveId, Tickets.Subject, Tickets.LastUpdated, <br>
> Transactions.Created, sum(Transactions.TimeTaken) from Tickets left join <br>> Transactions on Tickets.id = Transactions.ObjectId where <br>> Transactions.Created between DATE_FORMAT(NOW(),"%Y-%m-01") - interval 0 <br>
> month and DATE_FORMAT(NOW(),"%Y-%m-01") - interval -1 month group by <br>> Tickets.EffectiveId;<br>> <br>> Example Mysql Output:<br>> <br>> +-------------+--------------------+--------------------------+-------------------------+-------------------------------------+ <br>
> <br>> | EffectiveId | Subject               | LastUpdated               | <br>> Created                     | sum(Transactions.TimeTaken) |<br>> +-------------+--------------------+--------------------------+-------------------------+-------------------------------------+ <br>
> <br>> |       21984 | Example Ticket 1 | 2011-08-03 23:56:50 | 2011-08-03 <br>> 00:02:50 |                         510 |<br>> |       23322 | Example Ticket 2 | 2011-08-06 00:11:39 | 2011-08-03 <br>> 00:52:14 |                         480 |<br>
> |       25497 | Example Ticket 3 | 2011-08-01 22:25:10 | 2011-08-01 <br>> 22:25:10 |                         180 |<br>> |       29560 | Example Ticket 4 | 2011-08-02 00:16:59 | 2011-08-02 <br>> 00:16:58 |                          45 |<br>
> +-------------+--------------------+--------------------------+-------------------------+-------------------------------------+ <br>> <br>> 4 rows in set (0.13 sec)<br>> <br>> I hope this information helps.<br>
> <br>> -- <br>> Scott Benson<br>> A1 Networks<br>> (707)570-2021 x203<br>> <br>> <br>> On 8/8/11 8:34 AM, Gerard FENELON wrote:<br>>> I am not sure but you might be looking for ColumnMap<br>
>> Gerard<br>>><br>>> On 2011-08-05 17:43, Scott Benson wrote:<br>>>> No update on this?<br>>>><br>>>> -- <br>>>> Scott Benson<br>>>> A1 Networks<br>>>> (707)570-2021 x203<br>
>>><br>>>><br>>>> On 8/2/11 2:13 PM, Scott Benson wrote:<br>>>>> Is it possible to get custom information inside the "Query <br>>>>> Builder"?  We are trying to get "time worked" based on transactions <br>
>>>> between a time frame to show in a custom search.  Basically we want <br>>>>> to have a page for clients to log in with their user/pass and see a <br>>>>> page that shows,  tickets with time added between 2011-07-01 and <br>
>>>> 2011-07-31, and run a sum on the time.  We have a query that works, <br>>>>> but it requires joining Tickets and Transactions, and selecting <br>>>>> information from the Transactions database.  Does anyone know of a <br>
>>>> way that this can be accomplished.  Thanks in advance. <br>>><br>>><br>>> --------<br>>> 2011 Training: <a href="http://bestpractical.com/services/training.html">http://bestpractical.com/services/training.html</a><br>
>><br>> <br>> --------<br>> 2011 Training: <a href="http://bestpractical.com/services/training.html">http://bestpractical.com/services/training.html</a><br></div>