How to group by month & year in Crystal.

I know this is simple, but I'm new to Crystal.  I am doing a sales report and want to group data by the month the transaction was entered.  I have a time field in the transaction table, but don't know how to group by month or by year.  I know I need to create a formula, but don't know how and am short on time.  I will be learning more in the future on this since we are generating a ton of reports.

Thanks
nkrueger84Asked:
Who is Participating?
 
crgary_txConnect With a Mentor Commented:
i assume you have a date field in the table?

create two crystal formulas say..

//@year
year({datefield})

//@month
month({datefield})

then group the report based on the above formulas. you might want to format the group fields for year and month later

hth..
Gary
0
 
nkrueger84Author Commented:
Great - that works! How do I clean the field up?

I have this:
{Transaction.Time}) & '/' & Year ({Transaction.Time})

The output looks like this:
6.00/2,001.00

How do I get it to be this?
6/2001

Thanks!
Nick
0
 
crgary_txConnect With a Mentor Commented:
replace with this formula:

left(cstr(date({Transaction.Time})),2)+'/'+right(cstr(date({Transaction.Time})),4)
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
mlmccCommented:
You can also use the group field.

WHen you group on a date field you have an option to choose the period.
day, week, month, etc

mlmcc
0
 
suresh-infotechConnect With a Mentor Commented:
hi. Try this formula

ToText(Transaction.Time, "MM") + '/' + ToText(Transaction.Time, "yyyy")
0
 
nkrueger84Author Commented:
Thanks guys - I ended up using a combination of the 3 of your answers.  I appreciate everyone's help - I'm sure there will be many more Crystal questions...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.