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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping of a calculated value 1

Status
Not open for further replies.

tmozer

Programmer
Sep 11, 2004
66
US
I need to do a simple report for "jobs" completed between a parameter entered time period. I want to print and count four groups based on the turn-around-time from assigned date to completed date. The four groups would be 0-15 calendar days, 16-45 and 46 to 90 and >90. Is there a simple way to do my group via a simple day/date calculation??
 
Assuming that the dates are distinct fields in the database, create a formula containing:

if {table.completed date}-{table.assigned date} < 16 then
1
else if {table.completed date}-{table.assigned date} < 46 then
2
else if {table.completed date}-{table.assigned date} < 91 then
3
else
4

You might also have to consider either or both dates being null or some such.

If they're not distinct dates, pelase don't assume that people know your environment, post basic background info:

Crystal version
Databse/connectivity used
Example data (show tables/fields/data types)
Expected Output

-k

-k
 
Worked like a charm. Thanks so much!!
 
Now.........

I need to try to group and summarize my data by month and year. I am using 8.5 and these are distinct dates.

Obviously I will need to do a similar thing by evaluating each record (date field) for what year it is and what number month it is...... I would limit the groupings to 2000 on........
 
Create formula fields with a DatePart command to get the month or year. Then you could group by month within year, or use another formula field to create values for each month in the current year and for previous years as whole years, whichever you want.

If you don't want data before 2000, then put that as a limit in your record select,
{table.completed date} => Date(2000, 1, 1)

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Use Insert->Group->Select the date and set it to Month in the options.

If you're doing a summary, consider a cross-tab with the Column set to the date by Month

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top