By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,619 Members | 1,534 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,619 IT Pros & Developers. It's quick & easy.

Helpdesk database statistics crosstab report

P: n/a
Hello SQL and Crystal Reports friends,

I am trying to make a report and need some help please.

It is a helpdesk database. Jobs are logged, and then closed. Each of
these events is timestamped in the database in the date fields
“DateLogged” and “DateClosed”
Jan Feb Mar Apr

New Closed New Closed New Closed New Closed
10 5 13 6 23 6 45 25

etc.

I am trying to create a crosstab style report that will show each month
of the year along the top, and then the number of jobs logged and closed
during that month. The problem I am having is that when Crystal Groups
by the month, you have to specify a date field for the grouping. If I
select “DateLogged”, then the crosstab will accurately show all of the
jobs logged for that month, but is not correct for the jobs closed
during that month. The problem is that is counting the number of jobs
that were both logged AND closed during the grouped month.

Can anyone see how such a report is possible?

Furthermore, I would like to be able to calculate how many jobs were
open at the start of the month, as well as at the end of the month.

Thank you for your help.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
There isn't an easy way to create cross tabs in sql. The next version
of mssqlserver is suppose to have some crosstabs functions. If you
really want to do it in sql, I have 3 articles that explained how to
do it using transact-sql. (Painful)
http://www.sql-server-performance.co...rting_page.asp
Jul 20 '05 #2

P: n/a

Thanks for the feedback Louis. I read your article and it has given me
a few ideas, but isn't really what I'm after.

I have been able to achieve what I'm after partly by combining 2 queries
with the UNION operator. The first query aggregates the count of all
rows that occur on datelogged. The second query does the same with
dateclosed. Then I combine them to get the results. It works well, but
I am still looking for a way to count the number of jobs that were open
at a particular point in time.

Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.