[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

combining correct SQL syntax with Crystal Report

Posted on 2004-03-25
3
Medium Priority
?
329 Views
Last Modified: 2008-03-06
I am trying to get a count of unique ip's per unique UA.  Listing all UA with count(ip) desc.   Within SQL Query analyzer I am able to get the results by this syntax:

DROP TABLE #Tmp_Hosts
SELECT DISTINCT IP, UserAgent
INTO #Tmp_Hosts
FROM dailylogs

SELECT  UserAgent AS 'UA', COUNT(*) AS 'Hosts'
FROM #Tmp_Hosts
GROUP BY UA
ORDER BY Hosts DESC, UA

However, when using the 'add command' field in Crystal Reports it does not work.
Any suggestions?

Thanks
0
Comment
Question by:RG2DM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 10684412
Which version of Crystal?

One of the references I use claims CR has trouble with multiple select queries.

mlmcc
0
 
LVL 42

Accepted Solution

by:
frodoman earned 1000 total points
ID: 10686427
I'd consider creating a view w/in SQL Server:

CREATE VIEW Tmp_Hosts AS
SELECT DISTINCT IP, UserAgent
FROM dailylogs

And then use just the selection command in Crystal.  Not only will this be cleaner for Crystal, but your report will run much faster since the view will already exist and you won't have to do the time consuming "select distinct" everytime this report is opened.

frodoman
0
 

Author Comment

by:RG2DM
ID: 10687861
Running Crystal Reports 9.  I am trying to solve this in Crystal Reports so I don't have to go to the SQL administrator to have a view added, but if this is easiest I will.   Just trying to explore all other options first.

thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question