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

Grouping based on Prompt on Date

Status
Not open for further replies.

raja2008

Technical User
Apr 16, 2008
265
US
Hello Everyone!

Using crystal reports XI R2 .

I have a report with grouping based on date.

I was wondering if there is a way to change the grouping option to be changed between "Each day", "Each week" ,"Each month" based on the selection in a prompt.

Basically when the user picks "Day" from the prompt,the grouping should be on Day ,If they pick "Week" grouping should change to week.


Please help.
 
Use a formula like this as your group field:

if {?Parm} = "Daily" then
{table.date} else
if {?Parm} = "Weekly" then
{table.date}-dayofweek({table.date}) + 1 else
if {?Parm} = "Monthly" then
{table.date}-day({table.week})+1

When you insert a group on this, choose "on change of day".

-LB
 
That works beaytifully,

Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top