Print Page | Close Window

Grouping by Date

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9272
Printed Date: 04 May 2024 at 2:01pm


Topic: Grouping by Date
Posted By: Erinmichelle
Subject: Grouping by Date
Date Posted: 03 Mar 2010 at 9:49am
Please help!
 
Background:
The database that I am working with is very poorly designed.  It is an Access table that records the filling of drugs from an automatic machine - however, if 500 Tylenol are filled on 3/2 at 9am, there will be 500 identical lines recorded in the database, rather than just one line with a column that says "500 filled."  Because of this, when I am trying to write a report, I have to group the report by date and then time in order to show the total of that particular fill.
 
Problem:
When I group by date, it groups randomly.  For example, the group header will say 12/30 but then it will capture a few days worth, and then the next one will say like 1/6 and that will capture a few days worth.  I tried to change it so the group was a formula -
              totext(datevalue({date_filled}))
and then that showed all of the correct group headings but of course then the dates don't sort completely chronologically.  The real kicker is that if i then change it BACK to just sorting by the date, then it sorts correctly AND groups correctly.  However, when I close Crystal and then open the report back up, it goes back to the same problem where the group header is capturing a few days worth of data.
 
Any ideas???


-------------
Thanks!

Erin



Replies:
Posted By: FrnhtGLI
Date Posted: 03 Mar 2010 at 10:10am
Click on your group expert and under Group By: highligh the date group. Click Options...Look at the This section will be printed drop-down box and make sure it is set as 'for each day.' and not 'for each week.'
 
That would be the first thing I would check. If that's not it, then there is something else going on and someone else may have to help.


Posted By: Erinmichelle
Date Posted: 03 Mar 2010 at 12:27pm
That worked! Thank you so much! That little trick will definitely come in handy in the future.

-------------
Thanks!

Erin



Print Page | Close Window