<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Unable to use SELECT TOP (10) on CUIC Report Definition?</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=7908915" />
  <subtitle>Unable to use SELECT TOP (10) on CUIC Report Definition?</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=7908915</id>
  <updated>2013-06-18T22:46:11Z</updated>
  <dc:date>2013-06-18T22:46:11Z</dc:date>
  <entry>
    <title>RE: Unable to use SELECT TOP (10) on CUIC Report Definition?</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=13070423" />
    <author>
      <name>Gerard O&amp;#039;Rourke</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=13070423</id>
    <updated>2013-03-15T10:34:02Z</updated>
    <published>2013-03-15T10:34:02Z</published>
    <summary type="html">Got this working ages ago.
Should have update this dicussion.
below is a Report which grabs the last 20 calls.
You can filter on ANI so you only see the calls you made etc.
Very useful for troubleshooting and finding out what the Dialed number is, if the dialplan is not well designed.
[url=http://orourke.tv/web/doku.php?id=cisco:uc:icm:sql]http://orourke.tv/web/doku.php?id=cisco:uc:icm:sql[/url]
[url=http://orourke.tv/web/lib/exe/fetch.php?media=cisco:uc:icm:last20calls-callroutedetail_v1-02.zip]http://orourke.tv/web/lib/exe/fetch.php?media=cisco:uc:icm:last20calls-callroutedetail_v1-02.zip[/url]
Below is an extract of the SQL 
SET ARITHABORT OFF SET ANSI_WARNINGS OFF SET NOCOUNT ON
SELECT TOP (20)
StartDateTime = Route_Call_Detail.DateTime, 
DBDateTime = Route_Call_Detail.DbDateTime, 
ANI = ISNULL(Route_Call_Detail.ANI,'NULL'), 
DialedNumberString = Route_Call_Detail.DialedNumberString, 
RoutingClientID = Route_Call_Detail.RoutingClientID, 
RoutingClientName = Routing_Client.EnterpriseName,
..
..
..
..
FROM 
Route_Call_Detail(nolock), 
Script(nolock), 
Master_Script(nolock), 
Call_Type(nolock), 
Routing_Client(nolock)
WHERE
(Route_Call_Detail.ScriptID = Script.ScriptID) AND 
(Script.MasterScriptID = Master_Script.MasterScriptID) AND
(Route_Call_Detail.CallTypeID = Call_Type.CallTypeID) AND
(Route_Call_Detail.RoutingClientID = Routing_Client.RoutingClientID)AND
(Route_Call_Detail.DbDateTime &gt; GetDate()-1)
ORDER BY 
Route_Call_Detail.DbDateTime DESC
 </summary>
    <dc:creator>Gerard O&amp;#039;Rourke</dc:creator>
    <dc:date>2013-03-15T10:34:02Z</dc:date>
  </entry>
  <entry>
    <title>AUTO: Gregory Grebin is unavailable (returning 10/26/2012)</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7908935" />
    <author>
      <name>GREG GREBIN</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7908935</id>
    <updated>2012-10-21T18:04:07Z</updated>
    <published>2012-10-21T18:04:07Z</published>
    <summary type="html">I am out of the office until 10/26/2012.

I am on PTO with limited access to email and phone.



Note: This is an automated response to your message "New Message from
Gerard O'Rourke in Contact Center Reporting (CCR) - Contact Center
Reporting: Unable to use SELECT TOP (10) on CUIC Report Definition?" sent
on 10/21/2012 01:02:05 PM.

This is the only notification you will receive while this person is away.


Prime Therapeutics made the following annotations
---------------------------------------------------------------------
CONFIDENTIALITY NOTICE: The information contained in this communication may be confidential, and is intended only for the use of the recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender.


---------------------------------------------------------------------</summary>
    <dc:creator>GREG GREBIN</dc:creator>
    <dc:date>2012-10-21T18:04:07Z</dc:date>
  </entry>
  <entry>
    <title>Automatic reply: New Message from Gerard O'Rourke in Contact Center Reporti</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7908925" />
    <author>
      <name>Michael Oldham</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7908925</id>
    <updated>2012-10-21T18:03:08Z</updated>
    <published>2012-10-21T18:03:08Z</published>
    <summary type="html">I'm currently overseas till Nov 5th  with limited access to email. I will try to respond to your request in a timely fashion.</summary>
    <dc:creator>Michael Oldham</dc:creator>
    <dc:date>2012-10-21T18:03:08Z</dc:date>
  </entry>
  <entry>
    <title>Unable to use SELECT TOP (10) on CUIC Report Definition?</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7908914" />
    <author>
      <name>Gerard O&amp;#039;Rourke</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=7908914</id>
    <updated>2012-10-21T18:02:00Z</updated>
    <published>2012-10-21T18:02:00Z</published>
    <summary type="html">I would like to be able to create a report which outputs just the first 10 results from an SQL query.
 
My SQL query is fine when I run it on the server, but if I create the Report Definiation, it will not allow you use TOP (10) in the Query.
Anyone have any ideas to be able to work around this issue?
Is there another way to achieve the same result or does anyone know why I am unable to use TOP (10) in the SELECT Query?
Regards,
Gerry
 
 
 
 </summary>
    <dc:creator>Gerard O&amp;#039;Rourke</dc:creator>
    <dc:date>2012-10-21T18:02:00Z</dc:date>
  </entry>
</feed>

