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

Groups in Cross Tabs? 1

Status
Not open for further replies.

paula

Technical User
Feb 23, 2001
18
GB
I need to create a simple report based on monthly totals, in the following format:

May June July August
Total Records added: 12 10 56 23

Unfortunately, each record added to the database concerned only has an individual date, so I need group by month to provide the above stats. But then I am unable to present the info. in the format above (horizontal) - I've looked at cross tabs, but can't seem to use groups in them, only fields.

I'd be very grateful for any suggestions.
 
There are probably better solutions, but here is one I used for a similar problem:

1. Create a formula to return the first of the month for the date:

Formula = {File.DateField} - Weekday ({File.DateField}) + 1

2. Create a crosstab with the new formula as the column.

3. Modify the format of the column header to show the month only (you can do this with a custom format.

I hope this works for you.
 
If the field is a true date field, you can put the field into the columns box, and then highlight it and select "Group Options" on the right. This will allow you to do columns "For Each Month" just like the group break setting. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Ken, I tried your suggestion in my cross-tab. It's a lot simpler than what I came up with. I'm still fairly new to this, so I use the first thing I find that works. Now I know a better way. Thanks!
 
Rondalo & Ken - many thanks for your help.
My problem is well and truly solved and I've registered lots of Tipmaster votes for you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top