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

Grouping according to a date formula

Status
Not open for further replies.

Nassy

Programmer
Mar 27, 2003
121
GB
Hi

I have the following test data on employees:


Employee name Start Date
Sarah Jan 2003
Pete Feb 2003
Lee March 2003


What I want to do is organise the employees into groups for Jan, Feb and March. However - instead of showing just the employees who started each month I want to see the employees who are actually employed at the company each month.

So I would have:


Jan
Sarah
Feb
Sarah
Pete
March
Sarah
Pete
Lee


where the group March represents starters before March etc...

To try and organise the data as shown above I tried the following:

[ul][li]Create a Group based on the Start Date[/li]
[li]Create a Formula comparing the Group Start Date and see if it less than the Start date[/li]
[li]Try to create a second group using the formula [/li]
[/ul]

It was at step 3 where I ran into difficulty as the formula I created was not available to group on (possibly because I had used an already created group to create my formula)

So if anyone could give me some hints or tips on how to create a group based on a date, which includes all employees who started on or before that date, I would be very thankful..

Nassy



 
What you're trying to do is potentially show numerous results for each row of data.

If you have a payroll system, it will likely have entries for each person for each month, otherwise you'll probably have to create subreports to handle this as the data only exists once per person.

-k
 
Thanks for the quick response.

I have worked out now how to create subreports for each group to provide the required results.

In each subreport I have a total.

Is there any way of accessing these totals in the main report so I can create a graph with them?

Thanks

Nassy
 
Not that I'm aware of, sorry.

I would have suggested that you build this data externally (on the database side) had I known this was a requirement.

-k
 
Thanks for your help.

You have confirmed my suspicion - that I have to build the data up externally and then report off it. I know that it is possible to create a stored procedure that will create headcount totals and then I will be able to use these totals in my report. This is what I will do now. But it is definitely useful to know what can and can't be done in Crystal as I now understand how best to proceed.

Nassy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top