Print Page | Close Window

grouping by month using a formulas

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=8970
Printed Date: 07 May 2024 at 11:09am


Topic: grouping by month using a formulas
Posted By: Seabass
Subject: grouping by month using a formulas
Date Posted: 28 Jan 2010 at 6:05am

allright, so i solve my data convert issued, right now i have a formulas field that has a date.

I will like to group my records by month using that field. For some reasons, i cannot find that formula using the group expert... when i click on insert / group there is an option to go to the formula workshop but canot get it to work ....

any inputs will be appreciated...

Thanksin advacne,

Sebastien

 




Replies:
Posted By: Crystal Method
Date Posted: 28 Jan 2010 at 6:36am
Hi Sebastien,
 
Create a formula which gives you the month from your date field
 
month(<yourdatefield>)
 
create the group using the formula you have just created
 
Cheers


-------------
Seagate Crystal Reports 8.5.0.389 in the guise of INFOR:Reports as part of Infor:COM ERP software.


Posted By: Seabass
Date Posted: 28 Jan 2010 at 7:23am
awesome !
 
So the result is the month number... for example, 10 for october... is there a way to display as "October 2009" instead ?


Posted By: davejwhite
Date Posted: 28 Jan 2010 at 8:33am
You don't actually have to use a formula for this.
 
If you group by a date field, you get a third dropdown in the Group By dialog box which allows you to state the period you want to use. By month is on that list.


Posted By: davejwhite
Date Posted: 28 Jan 2010 at 8:35am
Oh - the second part of your question.
 
You can use
 
Monthname(Month(<<datefield>>))
 
If you are using the Group By direct on the field (as above), click the Options tab and use this formula to customise the Group Name.


Posted By: Seabass
Date Posted: 28 Jan 2010 at 8:48am

Thank you so much... i have this report they want later today and i am sad to say that i am stuck on that grouping deal.......

the date was converted using a formulas from a string.....
 
so i can display that date on my report but cannot group using it.... not sure why...when i use the group expert, only the field from the database are listed....
 
i clikc on options... then there is an option to groug using a fomulas but get lost tryingot use it.... in the dropdown above that check mark, the formulas (the one i sed to convert to a date) is not available for selection..


Posted By: davejwhite
Date Posted: 29 Jan 2010 at 1:07am
Hi again,
 
If a formula does not appear in the Group By list, it is because it is being calculated after Crystal Reports does the grouping bit.
 
Are you placing your converted Date in the Details section, or somewhere else? If it's a Details date, it should act like a field and you should be able to group by it.



Print Page | Close Window