I have a question that goes along with this. I use CR 7. I don't see datepart function. Is there a patch available from seagate?? (like the one available for dateadd).
Whenever you group by a date field, Crystal will ask you how often you want to group the data. Answer weekly and you are in business - a new row of data will appear for each week.
If you want your dates as columns instead of rows use a cross tab with your date field as the column and it works much the same way.
Let me know if you have any questions. Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
I've tried using weekly grouping, it's quite cool, but is there anyway of changing the "first day of week"? I'd like it to start each group on a Saturday instead of Sunday.
Yes there is, I have done this before but I cannot remember the formula off the top of my head. I am away from my office but I know I have this stored in my formula examples folder. It may be tomorrow morning before I can post this.
Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
1. Create a formula
{table.datefield} - dayofweek({table.datefield})
//points to the latest Saturday
2. Group on your formula
3. In "Insert Group" you choose "Customize Group Name Field"
there you select "Use a Formula as Group Name".
If your datefield is a DateTime field you write like this:
ToText(Date({table.datefield}) - dayofweek(Date({table.datefield})))
to nickfatool:
You can use Crystal Day of Week constants in the DatePart formula to specify which day is firstDayOfWeek, as follows
Week = DatePart ("ww",YOUR DATE GOES HERE,crSaturday)
to group on weeks beginning on Saturday (use other constants in this group to begin your week on any day).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.