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!

Group By Week (I'm a Newbie)

Status
Not open for further replies.

DarkAngel

Technical User
Jan 5, 2001
73
US
I'm a Newbie to Seagate Crystal Reports (using version 8.0). I am attempting to design a report that sorts by date and groups weekly. I have a basic understanding of the grouping but cannot find a function to group by date. Is it necessary to have a table of week numbers and date detail (daily dates) to do this? Then I can have it group by each week number.

Thanks,
D.A.
 
DrakAngel: No secret here - simply select your date field (must be a true date type) to group by (via Insert Group) and you will be given a choice of break frequency - weekly is one of these David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
dcm:

Thank you for your response. I have been beating myself up over this for two weeks. I didn't realize until reading your response that the dba and/or programmers are storing the date as a string type with the slashes. Argh! Storing the slashes is a bit of a space waster isn't it?

Is it possible to convert the string type to a true date type in CR and get the break frequency choices?

Thank you again,
D.A.
 
I have a formula that will do this in the FAQ area under common formulas. It is a complex formula but you don't need to understand it. You can simply cut and paste it into your report and put your field name in. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Ken:

Thank you for the heads up on the formula/FAQ area. I made a few modifications because our dates are stored as yyyy/mm/dd...it works great!

Thanks,
D.A.
 
Have tried out the thread and it seems that my computer is setup as Sunday being the first day of the week. Is there a setting that Crystal looks for to specify the first day of the week?
 
That is the default.
In V8 you can tell each formula that uses the DayofWeek() function which day you want to start with. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
I'm having a similar problem using CR8.5.
I'm using the weekly break frequency (in the group dlg) to group some data by week. This is working fine. The problem is that some customer do not use Sunday has first day of week. Is there some function to use tell CR the global variable that I can set to the customer first day of week?


Thanks
 
There is a way to change the starting point for the DayOfWeek function, but that doesn't affect the automatic date grouping in the report. You will have to write a formula that calculates the week,and group on that. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top