Joined: 07 Apr 2007
Location: United States
Online Status: Offline
Posts: 1
Topic: Newbie need help grouping report by months Posted: 07 Apr 2007 at 3:02pm
Hello,
I am trying to learn how to create reports. The report i am trying to make i would like it to display the customers name, tips, total amount spent. I would to group this information by the months let say customer made purchase in january, it will display all customer's that made a purchase with each month, with the information above. Any suggestion?
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 08 Apr 2007 at 11:24am
Since you are a newbie you should read my free chapters online. You will learn a lot from this material. For your question, you need to use the report expert and select the fields you mentioned here. But don't select any groups yet. Then after it creates the initial report, create a formula that uses code like Month(table.field) and then add a group based on that formula. This will tell it to group by the month of the year.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 09 Apr 2007 at 11:30am
If your groups will be spanning years, you'll need to add year to the formula. In order to get the sort order right, year needs to be first and you'll convert the whole thing to a string. It looks something like this:
To_Text({table.field}, 'yyyyMM')
Please note that the format string for dates is CASE SENSISTIVE - the 'M' must be a capital M to get the month, lower case gives you minutes.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum