Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to group by month & year in Crystal.

Posted on 2008-06-19
6
Medium Priority
?
6,536 Views
Last Modified: 2010-04-21
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
0
Comment
Question by:nkrueger84
6 Comments
 
LVL 13

Accepted Solution

by:
crgary_tx earned 1200 total points
ID: 21826184
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
 

Author Comment

by:nkrueger84
ID: 21826262
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
 
LVL 13

Assisted Solution

by:crgary_tx
crgary_tx earned 1200 total points
ID: 21826476
replace with this formula:

left(cstr(date({Transaction.Time})),2)+'/'+right(cstr(date({Transaction.Time})),4)
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 101

Expert Comment

by:mlmcc
ID: 21827357
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
 

Assisted Solution

by:suresh-infotech
suresh-infotech earned 800 total points
ID: 21829547
hi. Try this formula

ToText(Transaction.Time, "MM") + '/' + ToText(Transaction.Time, "yyyy")
0
 

Author Closing Comment

by:nkrueger84
ID: 31468962
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Integration Management Part 2
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question