Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting Question - Please Help

Status
Not open for further replies.

rsunra

IS-IT--Management
Sep 30, 2003
53
AU
G'day

I have a counting question. I'm still new to CR9 and this may be hard to do of someone out there (I'm hoping) will know the solution straight away.

I have a report that I need to determining the number of calls received for each client for the following:

#calls Received for the Last 7 days
#Calls Received for the Last 30 Days
#Calls Received Last Full Month
#Calls Received Month to Date (Start of Month to Date)

Each Call received generates an Event so I can count on that field.

I Guess it should Look something like this

Client Name

Last 7 Days Last 30 Days Month to Date October

30 105 26 110

I really don't know where to start.


Part 2 for another Report

I going to need to know the number of calls received for all clients for the last 7 day broken down by
First Number of calls received on each day. Then I'm going to need to break the calls down by the hour that they were received


Thanks in advance for you help on this one
 
Create 4 formula fields:

If {DateField} in dateadd("d",-7,CurrentDate) to CurrentDate then 1 else 0

If {DateField} in dateadd("d",-30,CurrentDate) to CurrentDate then 1 else 0

If {Datefield} in LastFullMonth then 1 else 0

If {Datefield} in YearToDate then 1 else 0

Then perform simple summaries on these fields, and hide the details section.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
An alternative is to use 4 Running Totals.

In the evaluate->use a formula apply dgillz logic but omitting the conditional logic, as in:

{DateField} in dateadd("d",-7,CurrentDate) to CurrentDate

This avoids using summaries and detail formulas, one formula per will do it, but either works.

-k
 
Thank you very much for your help so far:

When I try Dgillz answer using the following formula

If {Insert_Date} in
DateTime(Year(CurrentDate),Month(CurrentDate),Day(CurrentDate),05,30,00)-7 to
DateTime (Year(CurrentDate),Month(CurrentDate),Day(CurrentDate),05,29,59)
then 1 else 0

This return the count for all the records that I had in the main selection of the form If I selected last 30 days in the selection I get a count for the last 30 and it seems to disregarded my formula.


When I tired synapsevampire answer

I got a RT on the all the record but it was a continuous RT ie Started off as 0 then the next group was 55 the next was 120 just an increasing total. When I try to change on group I get just 0 and not the count I want.

In the Selection formula I have the following

{Result} >= 1 and
{Insert_Date} in DateTime(Year(CurrentDate),Month(CurrentDate),Day(CurrentDate),05,30,00)-60 to DateTime (Year(CurrentDate),Month(CurrentDate),Day(CurrentDate),05,29,59)

The reasons for the Results >= 1 is so I can count only completed transactions


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top